changeset 1783:cf3eb6252f42

Fix calculation of binary name (don't include full path!)
author Chris Cannam
date Tue, 17 Sep 2019 10:42:55 +0100
parents 2a810ed46977
children 4eac4bf35b45
files base/HelperExecPath.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/base/HelperExecPath.cpp	Tue Sep 17 09:28:27 2019 +0100
+++ b/base/HelperExecPath.cpp	Tue Sep 17 10:42:55 2019 +0100
@@ -72,13 +72,17 @@
 
     QStringList dirs;
     QString appName = QCoreApplication::applicationName();
-    QString binaryName = QCoreApplication::arguments().at(0);
     QString myDir = QCoreApplication::applicationDirPath();
+    QString binaryName = QFileInfo(QCoreApplication::arguments().at(0))
+        .fileName();
+        
 #ifdef Q_OS_MAC
     dirs.push_back(myDir + "/../Resources");
 #else
 #ifndef Q_OS_WIN32
-    dirs.push_back(myDir + "/../lib/" + binaryName);
+    if (binaryName != "") {
+        dirs.push_back(myDir + "/../lib/" + binaryName);
+    }
     dirs.push_back(myDir + "/../lib/" + appName);
 #endif
     dirs.push_back(myDir + "/helpers");