diff --git a/Telegram/SourceFiles/settings/settings_widget.cpp b/Telegram/SourceFiles/settings/settings_widget.cpp index 72b9f2a227..77856463d4 100644 --- a/Telegram/SourceFiles/settings/settings_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_widget.cpp @@ -48,9 +48,11 @@ void fillCodes() { Messenger::Instance().onSwitchTestMode(); })); }); +#ifndef TDESKTOP_DISABLE_AUTOUPDATE Codes.insert(qsl("testupdate"), [] { Core::UpdateChecker().test(); }); +#endif // TDESKTOP_DISABLE_AUTOUPDATE Codes.insert(qsl("loadlang"), [] { Lang::CurrentCloudManager().switchToLanguage(qsl("custom")); }); diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 0e72e2a0b6..f50b1ed425 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -2526,6 +2526,7 @@ void writeMtpData() { _writeMtpData(); } +#ifndef TDESKTOP_DISABLE_AUTOUPDATE const QString &AutoupdatePrefix(const QString &replaceWith = {}) { static auto value = QString(); if (!replaceWith.isEmpty()) { @@ -2552,8 +2553,10 @@ const QString &readAutoupdatePrefixRaw() { } return AutoupdatePrefix("http://updates.tdesktop.com"); } +#endif // TDESKTOP_DISABLE_AUTOUPDATE void writeAutoupdatePrefix(const QString &prefix) { +#ifndef TDESKTOP_DISABLE_AUTOUPDATE const auto current = readAutoupdatePrefixRaw(); if (current != prefix) { AutoupdatePrefix(prefix); @@ -2567,12 +2570,15 @@ void writeAutoupdatePrefix(const QString &prefix) { checker.start(); } } +#endif // TDESKTOP_DISABLE_AUTOUPDATE } +#ifndef TDESKTOP_DISABLE_AUTOUPDATE QString readAutoupdatePrefix() { auto result = readAutoupdatePrefixRaw(); return result.replace(QRegularExpression("/+$"), QString()); } +#endif // TDESKTOP_DISABLE_AUTOUPDATE void reset() { if (_localLoader) { diff --git a/Telegram/SourceFiles/storage/localstorage.h b/Telegram/SourceFiles/storage/localstorage.h index cd6185f974..8dd307a60d 100644 --- a/Telegram/SourceFiles/storage/localstorage.h +++ b/Telegram/SourceFiles/storage/localstorage.h @@ -28,7 +28,9 @@ void writeUserSettings(); void writeMtpData(); void writeAutoupdatePrefix(const QString &prefix); +#ifndef TDESKTOP_DISABLE_AUTOUPDATE QString readAutoupdatePrefix(); +#endif // TDESKTOP_DISABLE_AUTOUPDATE void reset();