mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 09:44:38 +00:00
There were change logic for get applicationPath
This commit is contained in:
parent
06b71bd9aa
commit
5218f2094c
13
params.cpp
13
params.cpp
@ -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 ¶msArray, 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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user