mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Make type variable const
This commit is contained in:
parent
2788c19c85
commit
3a021f4e49
1 changed files with 24 additions and 20 deletions
|
@ -447,27 +447,31 @@ bool ResolveSettings(
|
||||||
}
|
}
|
||||||
controller->window().activate();
|
controller->window().activate();
|
||||||
const auto section = match->captured(1).mid(1).toLower();
|
const auto section = match->captured(1).mid(1).toLower();
|
||||||
auto type = ::Settings::Main::Id();
|
|
||||||
if (section.isEmpty()) {
|
const auto getSectionType = [&]() -> std::optional<::Settings::Type> {
|
||||||
controller->window().showSettings();
|
if (section.isEmpty()) {
|
||||||
return true;
|
return ::Settings::Main::Id();
|
||||||
} else if (section == qstr("language")) {
|
} else if (section == qstr("language")) {
|
||||||
ShowLanguagesBox();
|
ShowLanguagesBox();
|
||||||
return true;
|
} else if (section == qstr("devices")) {
|
||||||
} else if (section == qstr("devices")) {
|
controller->session().api().authorizations().reload();
|
||||||
controller->session().api().authorizations().reload();
|
return ::Settings::Sessions::Id();
|
||||||
type = ::Settings::Sessions::Id();
|
} else if (section == qstr("folders")) {
|
||||||
} else if (section == qstr("folders")) {
|
return ::Settings::Folders::Id();
|
||||||
type = ::Settings::Folders::Id();
|
} else if (section == qstr("privacy")) {
|
||||||
} else if (section == qstr("privacy")) {
|
return ::Settings::PrivacySecurity::Id();
|
||||||
type = ::Settings::PrivacySecurity::Id();
|
} else if (section == qstr("themes")) {
|
||||||
} else if (section == qstr("themes")) {
|
return ::Settings::Chat::Id();
|
||||||
type = ::Settings::Chat::Id();
|
} else if (section == qstr("change_number")) {
|
||||||
} else if (section == qstr("change_number")) {
|
return ::Settings::ChangePhone::Id();
|
||||||
type = ::Settings::ChangePhone::Id();
|
}
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (const auto type = getSectionType()) {
|
||||||
|
controller->showSettings(*type);
|
||||||
|
controller->window().activate();
|
||||||
}
|
}
|
||||||
controller->showSettings(type);
|
|
||||||
controller->window().activate();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue