There were change logic for get applicationPath

This commit is contained in:
Alex 2024-08-02 12:37:38 +03:00
parent 06b71bd9aa
commit 5218f2094c

View File

@ -12,9 +12,8 @@
#include <QDateTime>
#include <QCoreApplication>
#include "qaglobalutils.h"
#include <QDir>
#include <QtLogging>
#include <mach-o/dyld.h>
#ifdef Q_OS_WIN
#include "windows.h"
@ -232,7 +231,15 @@ bool Params::parseParams(const QStringList &paramsArray, const OptionsDataList &
#endif
#ifdef Q_OS_DARWIN
appPath = QDir::currentPath();
uint32_t size = 0;
_NSGetExecutablePath(nullptr, &size); // request to buffer size
std::vector<char> buffer(size);
if (_NSGetExecutablePath(buffer.data(), &size) == 0) {
appPath = QString::fromUtf8(buffer.data());
} else {
appPath = QString();
}
appName = QCoreApplication::applicationName();
#endif