2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Instantiate QRegularExpression instances statically

This commit is contained in:
Ilya Fedin
2023-12-22 03:50:04 +04:00
committed by John Preston
parent 4b297bfa09
commit e6b9a07163
18 changed files with 74 additions and 47 deletions

View File

@@ -542,9 +542,13 @@ void Launcher::processArguments() {
}
}
static const auto RegExp = QRegularExpression("[^a-z0-9\\-_]");
gDebugMode = parseResult.contains("-debug");
gKeyFile = parseResult.value("-key", {}).join(QString()).toLower();
gKeyFile = gKeyFile.replace(QRegularExpression("[^a-z0-9\\-_]"), {});
gKeyFile = parseResult
.value("-key", {})
.join(QString())
.toLower()
.replace(RegExp, {});
gLaunchMode = parseResult.contains("-autostart") ? LaunchModeAutoStart
: parseResult.contains("-fixprevious") ? LaunchModeFixPrevious
: parseResult.contains("-cleanup") ? LaunchModeCleanup