diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index aa50e19a2..4f9eb8ed8 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -270,14 +270,10 @@ std::unique_ptr Launcher::Create(int argc, char *argv[]) { Launcher::Launcher( int argc, - char *argv[], - const QString &deviceModel, - const QString &systemVersion) + char *argv[]) : _argc(argc) , _argv(argv) -, _baseIntegration(_argc, _argv) -, _deviceModel(deviceModel) -, _systemVersion(systemVersion) { +, _baseIntegration(_argc, _argv) { base::Integration::Set(&_baseIntegration); } @@ -419,14 +415,6 @@ void Launcher::prepareSettings() { processArguments(); } -QString Launcher::deviceModel() const { - return _deviceModel; -} - -QString Launcher::systemVersion() const { - return _systemVersion; -} - uint64 Launcher::installationTag() const { return InstallationTag; } diff --git a/Telegram/SourceFiles/core/launcher.h b/Telegram/SourceFiles/core/launcher.h index 05648bdb1..8847fec81 100644 --- a/Telegram/SourceFiles/core/launcher.h +++ b/Telegram/SourceFiles/core/launcher.h @@ -15,9 +15,7 @@ class Launcher { public: Launcher( int argc, - char *argv[], - const QString &deviceModel, - const QString &systemVersion); + char *argv[]); static std::unique_ptr Create(int argc, char *argv[]); @@ -26,8 +24,6 @@ public: QString argumentsString() const; bool customWorkingDir() const; - QString deviceModel() const; - QString systemVersion() const; uint64 installationTag() const; bool checkPortableVersionFolder(); @@ -67,9 +63,6 @@ private: QStringList _arguments; BaseIntegration _baseIntegration; - const QString _deviceModel; - const QString _systemVersion; - bool _customWorkingDir = false; }; diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index a4b2eb8fb..3fe0abb4e 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -7,8 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "main/main_account.h" +#include "base/platform/base_platform_info.h" #include "core/application.h" -#include "core/launcher.h" #include "core/shortcuts.h" #include "storage/storage_account.h" #include "storage/storage_domain.h" // Storage::StartResult. @@ -386,8 +386,8 @@ void Account::startMtp(std::unique_ptr config) { auto fields = base::take(_mtpFields); fields.config = std::move(config); - fields.deviceModel = Core::App().launcher()->deviceModel(); - fields.systemVersion = Core::App().launcher()->systemVersion(); + fields.deviceModel = Platform::DeviceModelPretty(); + fields.systemVersion = Platform::SystemVersionPretty(); _mtp = std::make_unique( MTP::Instance::Mode::Normal, std::move(fields)); @@ -534,8 +534,8 @@ void Account::destroyMtpKeys(MTP::AuthKeysList &&keys) { destroyFields.mainDcId = MTP::Instance::Fields::kNoneMainDc; destroyFields.config = std::make_unique(_mtp->config()); destroyFields.keys = std::move(keys); - destroyFields.deviceModel = Core::App().launcher()->deviceModel(); - destroyFields.systemVersion = Core::App().launcher()->systemVersion(); + destroyFields.deviceModel = Platform::DeviceModelPretty(); + destroyFields.systemVersion = Platform::SystemVersionPretty(); _mtpForKeysDestroy = std::make_unique( MTP::Instance::Mode::KeysDestroyer, std::move(destroyFields)); diff --git a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp index f35c13be2..18840ea96 100644 --- a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp @@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "platform/linux/launcher_linux.h" -#include "base/platform/base_platform_info.h" #include "platform/linux/specific_linux.h" #include "core/crash_reports.h" #include "core/update_checker.h" @@ -46,7 +45,7 @@ private: } // namespace Launcher::Launcher(int argc, char *argv[]) -: Core::Launcher(argc, argv, DeviceModelPretty(), SystemVersionPretty()) { +: Core::Launcher(argc, argv) { } void Launcher::initHook() { diff --git a/Telegram/SourceFiles/platform/mac/launcher_mac.mm b/Telegram/SourceFiles/platform/mac/launcher_mac.mm index 94fa4d5e5..e68bb0b2c 100644 --- a/Telegram/SourceFiles/platform/mac/launcher_mac.mm +++ b/Telegram/SourceFiles/platform/mac/launcher_mac.mm @@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/crash_reports.h" #include "core/update_checker.h" -#include "base/platform/base_platform_info.h" #include "base/platform/base_platform_file_utilities.h" #include "base/platform/mac/base_utilities_mac.h" @@ -20,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Platform { Launcher::Launcher(int argc, char *argv[]) -: Core::Launcher(argc, argv, DeviceModelPretty(), SystemVersionPretty()) { +: Core::Launcher(argc, argv) { } void Launcher::initHook() { diff --git a/Telegram/SourceFiles/platform/win/launcher_win.cpp b/Telegram/SourceFiles/platform/win/launcher_win.cpp index 44821f1ea..199c06a42 100644 --- a/Telegram/SourceFiles/platform/win/launcher_win.cpp +++ b/Telegram/SourceFiles/platform/win/launcher_win.cpp @@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/crash_reports.h" #include "core/update_checker.h" -#include "base/platform/base_platform_info.h" #include "base/platform/win/base_windows_h.h" #include @@ -18,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Platform { Launcher::Launcher(int argc, char *argv[]) -: Core::Launcher(argc, argv, DeviceModelPretty(), SystemVersionPretty()) { +: Core::Launcher(argc, argv) { } std::optional Launcher::readArgumentsHook(