mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 17:54:40 +00:00
fix linux appPath
This commit is contained in:
parent
b87e4491cd
commit
1619356261
@ -13,6 +13,7 @@
|
|||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace QuasarAppUtils;
|
using namespace QuasarAppUtils;
|
||||||
@ -38,7 +39,9 @@ bool Params::parseParams(int argc, char *argv[]) {
|
|||||||
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
||||||
params ["appPath"] = QFileInfo(buffer).absolutePath();
|
params ["appPath"] = QFileInfo(buffer).absolutePath();
|
||||||
#else
|
#else
|
||||||
params ["appPath"] = QFileInfo(argv[0]).absolutePath();
|
char path[2048];
|
||||||
|
readlink("/proc/self/exe", path, 2048);
|
||||||
|
params ["appPath"] = QFileInfo(path).absolutePath();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!getStrArg("appPath").size()) {
|
if (!getStrArg("appPath").size()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user