]> git.cworth.org Git - apitrace/blobdiff - gui/main.cpp
qapitrace: Determine binary dir in run-time.
[apitrace] / gui / main.cpp
index 3ae56db1768ecc6528446006e2f4c77146fb74c8..471dec7939c7eccd88c4d1c882a121ea2a587b08 100644 (file)
@@ -3,6 +3,9 @@
 #include "apitrace.h"
 #include "apitracecall.h"
 
+#include "os_string.hpp"
+#include "os_process.hpp"
+
 #include <QApplication>
 #include <QMetaType>
 #include <QVariant>
@@ -34,8 +37,10 @@ int main(int argc, char **argv)
     qRegisterMetaType<QList<QImage> >();
 
 #ifndef Q_OS_WIN
+    os::String currentProcess = os::getProcessName();
+    currentProcess.trimFilename();
     QString path = qgetenv("PATH");
-    path = QLatin1String(APITRACE_BINARY_DIR) + QLatin1String(":") + path;
+    path = QLatin1String(currentProcess.str()) + QLatin1String(":") + path;
     qputenv("PATH", path.toLatin1());
 #endif