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

git-admin at x2go.org git-admin at x2go.org
Wed Jun 22 03:15:54 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 4d47af401c677ccdfcb64740fdc6ca34a76fc440
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 5e4f33b..eb8fb15 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -341,6 +341,8 @@ x2goclient (4.0.5.2-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.
   * debian/control:
     - Maintainer change in package: X2Go Developers <x2go-dev at lists.x2go.org>.
 
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