From 014c218afa3c8b600fe86918d49182ec1d32583f Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 29 Apr 2016 21:55:27 +0200 Subject: [PATCH] Fix swiftlauncher executable names for Linux platforms refs #615 --- src/blackmisc/buildconfig.cpp | 14 ++++++++++++++ src/blackmisc/buildconfig.h | 6 ++++++ src/swiftlauncher/swiftlauncher.cpp | 14 ++++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/blackmisc/buildconfig.cpp b/src/blackmisc/buildconfig.cpp index 3c553d521..b365539d1 100644 --- a/src/blackmisc/buildconfig.cpp +++ b/src/blackmisc/buildconfig.cpp @@ -77,6 +77,20 @@ namespace BlackMisc #endif } + bool CBuildConfig::isRunningOnLinuxPlatform() + { +#ifdef Q_OS_LINUX + return true; +#else + return false; +#endif + } + + bool CBuildConfig::isRunningOnUnixPlatform() + { + return isRunningOnMacOSXPlatform() || isRunningOnLinuxPlatform(); + } + bool CBuildConfig::isDebugBuild() { #ifdef QT_DEBUG diff --git a/src/blackmisc/buildconfig.h b/src/blackmisc/buildconfig.h index 665003b0d..c96080f54 100644 --- a/src/blackmisc/buildconfig.h +++ b/src/blackmisc/buildconfig.h @@ -77,6 +77,12 @@ namespace BlackMisc //! Running on Mac OS X platform? static bool isRunningOnMacOSXPlatform(); + //! Running on Linux platform? + static bool isRunningOnLinuxPlatform(); + + //! Running on Unix (Linux or Mac OS X) platform + static bool isRunningOnUnixPlatform(); + //! Application directory where current application is located //! \todo Move to to CApplication static const QString &getApplicationDir(); diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 5071a6091..852774fac 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -195,8 +195,10 @@ void CSwiftLauncher::startSwiftCore() } // I set this for debug purpose only - this->m_executableArgs = args; - this->m_executable = CBuildConfig::swiftCoreExecutableName(); + m_executableArgs = args; + m_executable.clear(); + if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; } + m_executable += CBuildConfig::swiftCoreExecutableName(); CLogMessage(this).info(this->getCmdLine()); // start @@ -205,7 +207,9 @@ void CSwiftLauncher::startSwiftCore() void CSwiftLauncher::setSwiftDataExecutable() { - m_executable = CBuildConfig::swiftDataExecutableName(); + m_executable.clear(); + if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; } + m_executable += CBuildConfig::swiftDataExecutableName(); m_executableArgs.clear(); } @@ -214,7 +218,9 @@ bool CSwiftLauncher::setSwiftGuiExecutable() QString msg; if (this->isStandaloneGuiSelected() || this->canConnectDBusServer(msg)) { - m_executable = CBuildConfig::swiftGuiExecutableName(); + m_executable.clear(); + if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; } + m_executable += CBuildConfig::swiftGuiExecutableName(); QStringList args { "--core", CoreModes::coreModeToString(getCoreMode()),