2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Get rid of redudant cmake options

This commit is contained in:
Ilya Fedin
2020-08-31 12:26:16 +04:00
committed by John Preston
parent f128665f6b
commit 70c993774a
9 changed files with 6 additions and 44 deletions

View File

@@ -43,20 +43,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Settings {
bool HasConnectionType() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
return true;
#endif // TDESKTOP_DISABLE_NETWORK_PROXY
return false;
}
void SetupConnectionType(
not_null<Main::Account*> account,
not_null<Ui::VerticalLayout*> container) {
if (!HasConnectionType()) {
return;
}
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
const auto connectionType = [=] {
const auto transport = account->mtp().dctransport();
if (Global::ProxySettings() != MTP::ProxyData::Settings::Enabled) {
@@ -81,7 +70,6 @@ void SetupConnectionType(
button->addClickHandler([=] {
Ui::show(ProxiesBoxController::CreateOwningBox(account));
});
#endif // TDESKTOP_DISABLE_NETWORK_PROXY
}
bool HasUpdate() {
@@ -571,13 +559,11 @@ void Advanced::setupContent(not_null<Window::SessionController*> controller) {
if (!cAutoUpdate()) {
addUpdate();
}
if (HasConnectionType()) {
addDivider();
AddSkip(content);
AddSubsectionTitle(content, tr::lng_settings_network_proxy());
SetupConnectionType(&controller->session().account(), content);
AddSkip(content);
}
addDivider();
AddSkip(content);
AddSubsectionTitle(content, tr::lng_settings_network_proxy());
SetupConnectionType(&controller->session().account(), content);
AddSkip(content);
SetupDataStorage(controller, content);
SetupAutoDownload(controller, content);
SetupSystemIntegration(content, [=](Type type) {

View File

@@ -15,7 +15,6 @@ class Account;
namespace Settings {
bool HasConnectionType();
void SetupConnectionType(
not_null<Main::Account*> account,
not_null<Ui::VerticalLayout*> container);

View File

@@ -128,13 +128,10 @@ auto GenerateCodes() {
Ui::hideLayer();
}));
});
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
codes.emplace(qsl("registertg"), [](SessionController *window) {
Platform::RegisterCustomScheme(true);
Ui::Toast::Show("Forced custom scheme register.");
});
#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
#if defined Q_OS_WIN || defined Q_OS_MAC
codes.emplace(qsl("freetype"), [](SessionController *window) {

View File

@@ -65,9 +65,7 @@ object_ptr<Ui::RpWidget> CreateIntroSettings(
AddDivider(result);
AddSkip(result);
SetupLanguageButton(result, false);
if (HasConnectionType()) {
SetupConnectionType(&window->account(), result);
}
SetupConnectionType(&window->account(), result);
AddSkip(result);
if (HasUpdate()) {
AddDivider(result);