[X2Go-Commits] [x2goclient] 12/18: src/pulsemanager.{cpp, h}: add new pulse_version_valid_ boolean class member variable, set it correctly and use it whenever the version is accessed.

git-admin at x2go.org git-admin at x2go.org
Sat Feb 25 06:19:50 CET 2017


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

x2go pushed a commit to branch master
in repository x2goclient.

commit 3030702728bb27d5f2e6e0b83b5ff04782f7cfdb
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Feb 25 04:53:19 2017 +0100

    src/pulsemanager.{cpp,h}: add new pulse_version_valid_ boolean class member variable, set it correctly and use it whenever the version is accessed.
---
 debian/changelog     |    3 +++
 src/pulsemanager.cpp |   17 +++++++++++++++--
 src/pulsemanager.h   |    1 +
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index aee212b..c2830d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -99,6 +99,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium
       XQuartz project homepage references, adapt translations.
     - src/pulsemanager.{cpp,h}: make get_* () functions const.
     - src/pulsemanager.{cpp,h}: make is_server_running () const.
+    - src/pulsemanager.{cpp,h}: add new pulse_version_valid_ boolean class
+      member variable, set it correctly and use it whenever the version is
+      accessed.
 
   [ Oleksandr Shneyder ]
   * New upstream version (4.1.0.1):
diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp
index a5c164c..5805099 100644
--- a/src/pulsemanager.cpp
+++ b/src/pulsemanager.cpp
@@ -43,6 +43,7 @@ PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()),
                                 pulse_version_minor_ (0),
                                 pulse_version_micro_ (0),
                                 pulse_version_misc_ (""),
+                                pulse_version_valid_ (false),
                                 record_ (true),
                                 playback_ (true),
                                 debug_ (false),
@@ -272,6 +273,10 @@ void PulseManager::start_osx () {
                << "-F" << QDir::toNativeSeparators (pulse_dir_.absolutePath () + "/config.pa");
 
   if (!system_pulse_) {
+    if (!(pulse_version_valid_)) {
+      x2goDebug << "PulseAudio version number was not fetched successfully, data is invalid. Continuing anyway.";
+    }
+
     server_args_ << "-p"
                  << QDir::toNativeSeparators (QDir (app_dir_
                                                     + "/../Frameworks/pulse-"
@@ -303,6 +308,11 @@ void PulseManager::start_win () {
  */
 #ifdef Q_OS_WIN
   server_args_ = QStringList ();
+
+  if (!(pulse_version_valid_)) {
+    x2goDebug << "PulseAudio version number was not fetched successfully, data is invalid. Continuing anyway.";
+  }
+
   server_args_ << "--exit-idle-time=-1" << "-n"
                << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath ()
                                                           + "/config.pa").absolutePath ())
@@ -511,13 +521,16 @@ void PulseManager::fetch_pulseaudio_version () {
             show_RichText_ErrorMsgBox (tr ("Error fetching PulseAudio version number!"),
                                        tr ("Unable to convert micro version number string to integer."),
                                        true);
-            abort ();
+            stop_processing = true;
           }
         }
 
         /* Misc version part will be set to the trailing string. */
         if (found) {
           pulse_version_misc_ = tmp_remaining_str;
+
+          pulse_version_valid_ = true;
+
           break;
         }
       }
@@ -607,7 +620,7 @@ bool PulseManager::generate_server_config () {
      * Tanu Kaskinen recommended we specify the absolute path instead.
      * The absolute path works with at least 5.0 and 6.0.
      */
-    if (pulse_version_major_ > 2) {
+    if ((!(pulse_version_valid_)) || (pulse_version_major_ > 2)) {
       QString clean_pulse_dir = pulse_dir_.absolutePath ();
 
 #ifdef Q_OS_WIN
diff --git a/src/pulsemanager.h b/src/pulsemanager.h
index 38cc837..5c852ed 100644
--- a/src/pulsemanager.h
+++ b/src/pulsemanager.h
@@ -119,6 +119,7 @@ class PulseManager: public QObject {
     std::uint32_t pulse_version_minor_;
     std::uint32_t pulse_version_micro_;
     QString pulse_version_misc_;
+    bool pulse_version_valid_;
 
     bool record_;
     bool playback_;

--
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