From a45d80b8d7137065a6fc00995925d81d813f6762 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Sat, 19 Oct 2019 01:20:07 +0300 Subject: [PATCH] Removed font start option --- Telegram/SourceFiles/_other/updater.cpp | 22 ++----------- Telegram/SourceFiles/_other/updater_linux.cpp | 25 --------------- Telegram/SourceFiles/_other/updater_osx.m | 32 +------------------ Telegram/SourceFiles/core/launcher.cpp | 9 ------ .../platform/linux/launcher_linux.cpp | 15 --------- .../SourceFiles/platform/mac/launcher_mac.mm | 15 --------- .../SourceFiles/platform/win/launcher_win.cpp | 15 --------- 7 files changed, 3 insertions(+), 130 deletions(-) diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index c612941f1..40f8ee248 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL bool _debug = false; -wstring updaterName, updaterDir, updateTo, exeName, customWorkingDir, customKeyFile, mainFont, semiboldFont, monospacedFont; +wstring updaterName, updaterDir, updateTo, exeName, customWorkingDir, customKeyFile; bool equal(const wstring &a, const wstring &b) { return !_wcsicmp(a.c_str(), b.c_str()); @@ -339,7 +339,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara LPWSTR *args; int argsCount; - bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false, externalupdater = false, semiboldisbold = false; + bool needupdate = false, autostart = false, debug = false, writeprotected = false, startintray = false, testmode = false, externalupdater = false; args = CommandLineToArgvW(GetCommandLine(), &argsCount); if (args) { for (int i = 1; i < argsCount; ++i) { @@ -381,14 +381,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara break; } } - } else if (equal(args[i], L"-mainfont") && ++i < argsCount) { - mainFont = args[i]; - } else if (equal(args[i], L"-semiboldfont") && ++i < argsCount) { - semiboldFont = args[i]; - } else if (equal(args[i], L"-semiboldisbold")) { - semiboldisbold = true; - } else if (equal(args[i], L"-monospacefont") && ++i < argsCount) { - monospacedFont = args[i]; } } if (exeName.empty()) { @@ -442,16 +434,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara if (!customKeyFile.empty()) { targs += L" -key \"" + customKeyFile + L"\""; } - if (!mainFont.empty()) { - targs += L" -mainfont \"" + mainFont + L"\""; - } - if (!semiboldFont.empty()) { - targs += L" -semiboldfont \"" + semiboldFont + L"\""; - } - if (semiboldisbold) targs += L" -semiboldisbold"; - if (!monospacedFont.empty()) { - targs += L" -monospacefont \"" + monospacedFont + L"\""; - } writeLog(L"Result arguments: " + targs); bool executed = false; diff --git a/Telegram/SourceFiles/_other/updater_linux.cpp b/Telegram/SourceFiles/_other/updater_linux.cpp index 32fb8039f..d56478ba2 100644 --- a/Telegram/SourceFiles/_other/updater_linux.cpp +++ b/Telegram/SourceFiles/_other/updater_linux.cpp @@ -46,9 +46,6 @@ string updaterName; string workDir; string exeName; string exePath; -string mainFont; -string semiboldFont; -string monospacedFont; FILE *_logFile = 0; void openLog() { @@ -344,7 +341,6 @@ int main(int argc, char *argv[]) { bool testmode = false; bool externalupdater = false; bool customWorkingDir = false; - bool semiboldIsBold = false; char *key = 0; char *workdir = 0; @@ -373,14 +369,6 @@ int main(int argc, char *argv[]) { exeName = argv[i]; } else if (equal(argv[i], "-exepath") && ++i < argc) { exePath = argv[i]; - } else if (equal(argv[i], "-mainfont") && ++i < argc) { - mainFont = argv[i]; - } else if (equal(argv[i], "-semiboldfont") && ++i < argc) { - semiboldFont = argv[i]; - } else if (equal(argv[i], "-semiboldisbold")) { - semiboldIsBold = true; - } else if (equal(argv[i], "-monospacefont") && ++i < argc) { - monospacedFont = argv[i]; } } if (exeName.empty() || exeName.find('/') != string::npos) { @@ -477,19 +465,6 @@ int main(int argc, char *argv[]) { push("-workdir"); push(workdir); } - if (!mainFont.empty()) { - push("-mainfont"); - push(mainFont); - } - if (!semiboldFont.empty()) { - push("-semiboldfont"); - push(semiboldFont); - } - if (semiboldIsBold) push("-semiboldisbold"); - if (!monospacedFont.empty()) { - push("-monospacefont"); - push(monospacedFont); - } auto args = vector(); for (auto &arg : values) { diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index 7b1e9b6bc..c93fba25a 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -11,9 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL NSString *appName = @"Telegram.app"; NSString *appDir = nil; NSString *workDir = nil; -NSString *mainFont = nil; -NSString *semiboldFont = nil; -NSString *monospacedFont = nil; #ifdef _DEBUG BOOL _debug = YES; @@ -93,7 +90,7 @@ int main(int argc, const char * argv[]) { openLog(); pid_t procId = 0; - BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO, externalUpdater = NO, semiboldIsBold = NO; + BOOL update = YES, toSettings = NO, autoStart = NO, startInTray = NO, testMode = NO, externalUpdater = NO; BOOL customWorkingDir = NO; NSString *key = nil; for (int i = 0; i < argc; ++i) { @@ -125,20 +122,6 @@ int main(int argc, const char * argv[]) { customWorkingDir = YES; } else if ([@"-key" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { if (++i < argc) key = [NSString stringWithUTF8String:argv[i]]; - } else if ([@"-mainfont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { - if (++i < argc) { - mainFont = [NSString stringWithUTF8String:argv[i]]; - } - } else if ([@"-semiboldfont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { - if (++i < argc) { - semiboldFont = [NSString stringWithUTF8String:argv[i]]; - } - } else if ([@"-semiboldisbold" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { - semiboldIsBold = YES; - } else if ([@"-monospacefont" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { - if (++i < argc) { - monospacedFont = [NSString stringWithUTF8String:argv[i]]; - } } } if (!workDir) { @@ -282,19 +265,6 @@ int main(int argc, const char * argv[]) { [args addObject:@"-workdir"]; [args addObject:workDir]; } - if (mainFont) { - [args addObject:@"-mainfont"]; - [args addObject:mainFont]; - } - if (semiboldFont) { - [args addObject:@"-semiboldfont"]; - [args addObject:semiboldFont]; - } - if (semiboldIsBold) [args addObject:@"-semiboldisbold"]; - if (monospacedFont) { - [args addObject:@"-monospacefont"]; - [args addObject:monospacedFont]; - } writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]); for (int i = 0; i < 5; ++i) { diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index badf85fff..86742903f 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -392,10 +392,6 @@ void Launcher::processArguments() { { "-workdir" , KeyFormat::OneValue }, { "--" , KeyFormat::OneValue }, { "-scale" , KeyFormat::OneValue }, - { "-mainfont" , KeyFormat::OneValue }, - { "-semiboldfont" , KeyFormat::OneValue }, - { "-semiboldisbold" , KeyFormat::NoValues }, - { "-monospacefont" , KeyFormat::OneValue }, }; auto parseResult = QMap(); auto parsingKey = QByteArray(); @@ -453,11 +449,6 @@ void Launcher::processArguments() { ? style::kScaleAuto : value; } - - gMainFont = parseResult.value("-mainfont", {}).join(QString()); - gSemiboldFont = parseResult.value("-semiboldfont", {}).join(QString()); - gSemiboldFontIsBold = parseResult.contains("-semiboldisbold"); - gMonospaceFont = parseResult.value("-monospacefont", {}).join(QString()); } int Launcher::executeApplication() { diff --git a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp index 7b6b32b21..2722ffbff 100644 --- a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp @@ -75,21 +75,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) { argumentsList.push("-externalupdater"); } #endif // !TDESKTOP_DISABLE_AUTOUPDATE - if (!cMainFont().isEmpty()) { - argumentsList.push("-mainfont"); - argumentsList.push(QFile::encodeName(cMainFont())); - } - if (!cSemiboldFont().isEmpty()) { - argumentsList.push("-semiboldfont"); - argumentsList.push(QFile::encodeName(cSemiboldFont())); - } - if (cSemiboldFontIsBold()) { - argumentsList.push("-semiboldisbold"); - } - if (!cMonospaceFont().isEmpty()) { - argumentsList.push("-monospacefont"); - argumentsList.push(QFile::encodeName(cMonospaceFont())); - } if (cDataFile() != qsl("data")) { argumentsList.push("-key"); argumentsList.push(QFile::encodeName(cDataFile())); diff --git a/Telegram/SourceFiles/platform/mac/launcher_mac.mm b/Telegram/SourceFiles/platform/mac/launcher_mac.mm index c80505525..23d4dadca 100644 --- a/Telegram/SourceFiles/platform/mac/launcher_mac.mm +++ b/Telegram/SourceFiles/platform/mac/launcher_mac.mm @@ -67,21 +67,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (Core::UpdaterDisabled()) [args addObject:@"-externalupdater"]; #endif // !TDESKTOP_DISABLE_AUTOUPDATE - if (!cMainFont().isEmpty()) { - [args addObject:@"-mainfont"]; - [args addObject:Q2NSString(cMainFont())]; - } - if (!cSemiboldFont().isEmpty()) { - [args addObject:@"-semiboldfont"]; - [args addObject:Q2NSString(cSemiboldFont())]; - } - if (cSemiboldFontIsBold()) { - argumentsList.push(qsl("-semiboldisbold")); - } - if (!cMonospaceFont().isEmpty()) { - [args addObject:@"-monospacefont"]; - [args addObject:Q2NSString(cMonospaceFont())]; - } if (cDataFile() != qsl("data")) { [args addObject:@"-key"]; [args addObject:Q2NSString(cDataFile())]; diff --git a/Telegram/SourceFiles/platform/win/launcher_win.cpp b/Telegram/SourceFiles/platform/win/launcher_win.cpp index 727b17059..5eda272fb 100644 --- a/Telegram/SourceFiles/platform/win/launcher_win.cpp +++ b/Telegram/SourceFiles/platform/win/launcher_win.cpp @@ -80,21 +80,6 @@ bool Launcher::launchUpdater(UpdaterLaunch action) { pushArgument(qsl("-workdir")); pushArgument('"' + cWorkingDir() + '"'); } - if (!cMainFont().isEmpty()) { - pushArgument(qsl("-mainfont")); - pushArgument('"' + cMainFont() + '"'); - } - if (!cSemiboldFont().isEmpty()) { - pushArgument(qsl("-semiboldfont")); - pushArgument('"' + cSemiboldFont() + '"'); - } - if (cSemiboldFontIsBold()) { - pushArgument(qsl("-semiboldisbold")); - } - if (!cMonospaceFont().isEmpty()) { - pushArgument(qsl("-monospacefont")); - pushArgument('"' + cMonospaceFont() + '"'); - } if (cDataFile() != qsl("data")) { pushArgument(qsl("-key")); pushArgument('"' + cDataFile() + '"');