[X2Go-Commits] [x2goclient] 05/05: src/pulsemanager.cpp: hide Windows-only code behind #ifdefs.
git-admin at x2go.org
git-admin at x2go.org
Fri May 6 23:50: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 b750d19da9cf38a64055e6bf520f8505772c95fe
Author: Mihai Moldovan <ionic at ionic.de>
Date: Fri May 6 23:49:35 2016 +0200
src/pulsemanager.cpp: hide Windows-only code behind #ifdefs.
Otherwise we'll get compile failures on non-Windows platforms.
---
debian/changelog | 2 ++
src/pulsemanager.cpp | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 4054c1a..1dfded0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -285,6 +285,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium
- src/onmainwindow.cpp: make use of new PulseManager::start () behavior
and always use it, no matter whether server is up already or not.
- src/pulsemanager.cpp: fix compile error due to typo.
+ - src/pulsemanager.cpp: hide Windows-only code behind #ifdefs. Otherwise
+ we'll get compile failures on non-Windows platforms.
[ Mike DePaulo ]
* New upstream release (4.0.5.2):
diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp
index ca7926c..21049ca 100644
--- a/src/pulsemanager.cpp
+++ b/src/pulsemanager.cpp
@@ -176,6 +176,11 @@ void PulseManager::start_osx () {
}
void PulseManager::start_win () {
+/*
+ * Some code in here is Windows-specific and will lead to compile
+ * failures on other platforms. Make this a stub for everything non-Windows.
+ */
+#ifdef Q_OS_WIN
server_args_ = QStringList ();
server_args_ << "--exit-idle-time=-1" << "-n"
<< "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath ()
@@ -215,6 +220,7 @@ void PulseManager::start_win () {
start_generic ();
}
+#endif /* defined (Q_OS_WIN) */
}
void PulseManager::start_linux () {
@@ -419,11 +425,18 @@ bool PulseManager::generate_server_config () {
* The absolute path works with at least 5.0 and 6.0.
*/
if (pulse_version_major_ > 2) {
- QString tmp_auth_cookie = QDir::toNativeSeparators (wapiShortFileName (pulse_dir_.absolutePath ()))
- + "\\.pulse-cookie";
+ QString clean_pulse_dir = pulse_dir_.absolutePath ();
+
+#ifdef Q_OS_WIN
+ clean_pulse_dir = wapiShortFileName (clean_pulse_dir);
+#endif /* defined (Q_OS_WIN) */
+ QString tmp_auth_cookie = QDir::toNativeSeparators (clean_pulse_dir + "/.pulse-cookie");
+
+#ifdef Q_OS_WIN
/* Double backslashes are required in config.pa. */
tmp_auth_cookie.replace ("\\", "\\\\");
+#endif /* defined (Q_OS_WIN) */
config_tmp_file_stream << " auth-cookie=" + tmp_auth_cookie;
}
--
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