diff --git a/params.cpp b/params.cpp index 3e69845..6bbe5ed 100644 --- a/params.cpp +++ b/params.cpp @@ -12,9 +12,8 @@ #include #include #include "qaglobalutils.h" -#include #include - +#include #ifdef Q_OS_WIN #include "windows.h" @@ -232,7 +231,15 @@ bool Params::parseParams(const QStringList ¶msArray, const OptionsDataList & #endif #ifdef Q_OS_DARWIN - appPath = QDir::currentPath(); + uint32_t size = 0; + _NSGetExecutablePath(nullptr, &size); // request to buffer size + std::vector buffer(size); + if (_NSGetExecutablePath(buffer.data(), &size) == 0) { + appPath = QString::fromUtf8(buffer.data()); + } else { + appPath = QString(); + } + appName = QCoreApplication::applicationName(); #endif