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"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
using namespace QuasarAppUtils;
|
||||
@ -38,7 +39,9 @@ bool Params::parseParams(int argc, char *argv[]) {
|
||||
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
||||
params ["appPath"] = QFileInfo(buffer).absolutePath();
|
||||
#else
|
||||
params ["appPath"] = QFileInfo(argv[0]).absolutePath();
|
||||
char path[2048];
|
||||
readlink("/proc/self/exe", path, 2048);
|
||||
params ["appPath"] = QFileInfo(path).absolutePath();
|
||||
#endif
|
||||
|
||||
if (!getStrArg("appPath").size()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user