[X2Go-Commits] [x2goclient] 186/219: src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required.

git-admin at x2go.org git-admin at x2go.org
Thu Sep 22 04:37:29 CEST 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit 70822995788d4e85439391bd9e0b10ccf9ee7639
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Jun 22 02:33:27 2016 +0200

    src/pulsemanager.cpp: correctly initialize and set system_pulse_ when required.
---
 debian/changelog     |    2 ++
 src/pulsemanager.cpp |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 595003e..afe6db7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -316,6 +316,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
     - src/x2goutils.cpp: fix compile error.
     - src/pulsemanager.h: add new system_pulse_ variable to indicate that
       a system PA binary shall be used.
+    - src/pulsemanager.cpp: correctly initialize and set system_pulse_ when
+      required.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Mon, 19 Sep 2016 09:07:07 +0200
 
diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp
index 8e25b77..9ec2da8 100644
--- a/src/pulsemanager.cpp
+++ b/src/pulsemanager.cpp
@@ -45,7 +45,8 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()),
                                 pulse_version_misc_ (""),
                                 record_ (true),
                                 playback_ (true),
-                                debug_ (false) {
+                                debug_ (false),
+                                system_pulse_ (false) {
   pulse_dir_ = QDir (QDir::homePath ());
   pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp");
   pulse_dir_.cd (pulse_X2Go_.mid (1));
@@ -84,6 +85,9 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()),
       x2goErrorf (29) << "Unable to find PulseAudio binary. Neither bundled, nor found in $PATH nor additional directories.";
       abort ();
     }
+    else {
+      system_pulse_ = true;
+    }
   }
 #else /* QT_VERSION < 0x050000 */
   QStringList search_paths;
@@ -114,6 +118,14 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()),
         }
       }
     }
+
+    /*
+     * The detection above either failed or succeeded.
+     * Failure means that the program already stopped,
+     * success means that all code reaches this point.
+     * Be careful when refactoring this code.
+     */
+    system_pulse_ = true;
   }
 #endif /* QT_VERSION < 0x050000 */
 

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list