mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Fix -debug argument
processArguments is called before ComputeDebugMode gets called, Logs::DebugEnabled gets overriden that way. Fix that by setting gDebugMode variable and checking it in ComputeDebugMode.
This commit is contained in:
parent
0cd68f866d
commit
f128665f6b
3 changed files with 6 additions and 1 deletions
|
@ -94,6 +94,9 @@ void ComputeDebugMode() {
|
||||||
if (file.exists() && file.open(QIODevice::ReadOnly)) {
|
if (file.exists() && file.open(QIODevice::ReadOnly)) {
|
||||||
Logs::SetDebugEnabled(file.read(1) != "0");
|
Logs::SetDebugEnabled(file.read(1) != "0");
|
||||||
}
|
}
|
||||||
|
if (cDebugMode()) {
|
||||||
|
Logs::SetDebugEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComputeExternalUpdater() {
|
void ComputeExternalUpdater() {
|
||||||
|
@ -482,7 +485,7 @@ void Launcher::processArguments() {
|
||||||
SetUpdaterDisabledAtStartup();
|
SetUpdaterDisabledAtStartup();
|
||||||
}
|
}
|
||||||
gUseFreeType = parseResult.contains("-freetype");
|
gUseFreeType = parseResult.contains("-freetype");
|
||||||
Logs::SetDebugEnabled(parseResult.contains("-debug"));
|
gDebugMode = parseResult.contains("-debug");
|
||||||
gManyInstance = parseResult.contains("-many");
|
gManyInstance = parseResult.contains("-many");
|
||||||
gKeyFile = parseResult.value("-key", {}).join(QString()).toLower();
|
gKeyFile = parseResult.value("-key", {}).join(QString()).toLower();
|
||||||
gKeyFile = gKeyFile.replace(QRegularExpression("[^a-z0-9\\-_]"), {});
|
gKeyFile = gKeyFile.replace(QRegularExpression("[^a-z0-9\\-_]"), {});
|
||||||
|
|
|
@ -47,6 +47,7 @@ bool gRestartingUpdate = false, gRestarting = false, gRestartingToSettings = fal
|
||||||
int32 gLastUpdateCheck = 0;
|
int32 gLastUpdateCheck = 0;
|
||||||
bool gNoStartUpdate = false;
|
bool gNoStartUpdate = false;
|
||||||
bool gStartToSettings = false;
|
bool gStartToSettings = false;
|
||||||
|
bool gDebugMode = false;
|
||||||
|
|
||||||
uint32 gConnectionsInSession = 1;
|
uint32 gConnectionsInSession = 1;
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ DeclareSetting(bool, WriteProtected);
|
||||||
DeclareSetting(int32, LastUpdateCheck);
|
DeclareSetting(int32, LastUpdateCheck);
|
||||||
DeclareSetting(bool, NoStartUpdate);
|
DeclareSetting(bool, NoStartUpdate);
|
||||||
DeclareSetting(bool, StartToSettings);
|
DeclareSetting(bool, StartToSettings);
|
||||||
|
DeclareSetting(bool, DebugMode);
|
||||||
DeclareReadSetting(bool, ManyInstance);
|
DeclareReadSetting(bool, ManyInstance);
|
||||||
|
|
||||||
DeclareSetting(QByteArray, LocalSalt);
|
DeclareSetting(QByteArray, LocalSalt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue