mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-05-01 12:09:45 +00:00
fix appName
This commit is contained in:
parent
fda3f1ffb2
commit
9c26f7af14
@ -121,6 +121,7 @@ bool Params::writeLoginFile(const QString &log, VerboseLvl vLvl) {
|
|||||||
if (!isEndable("noWriteInFileLog")) {
|
if (!isEndable("noWriteInFileLog")) {
|
||||||
|
|
||||||
QString path = getStrArg("appPath") + "/" + getStrArg("appName") + ".log";
|
QString path = getStrArg("appPath") + "/" + getStrArg("appName") + ".log";
|
||||||
|
|
||||||
if (isEndable("fileLog")) {
|
if (isEndable("fileLog")) {
|
||||||
QString path = getStrArg("fileLog");
|
QString path = getStrArg("fileLog");
|
||||||
}
|
}
|
||||||
@ -135,6 +136,7 @@ bool Params::writeLoginFile(const QString &log, VerboseLvl vLvl) {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -155,12 +157,16 @@ bool Params::parseParams(const QStringList ¶msArray) {
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
char buffer[MAX_PATH];
|
char buffer[MAX_PATH];
|
||||||
|
memset(path, 0, sizeof path);
|
||||||
|
|
||||||
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
||||||
params ["appPath"] = QFileInfo(buffer).absolutePath();
|
params ["appPath"] = QFileInfo(buffer).absolutePath();
|
||||||
params ["appName"] = QFileInfo(buffer).fileName();
|
params ["appName"] = QFileInfo(buffer).fileName();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
char path[2048];
|
char path[2048];
|
||||||
|
memset(path, 0, sizeof path);
|
||||||
|
|
||||||
if (readlink("/proc/self/exe", path, 2048) < 0) {
|
if (readlink("/proc/self/exe", path, 2048) < 0) {
|
||||||
qWarning() << "parseParams can't get self path!" ;
|
qWarning() << "parseParams can't get self path!" ;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user