mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Suggested code improvements
This commit is contained in:
parent
3a021f4e49
commit
fafbbb4996
1 changed files with 3 additions and 3 deletions
|
@ -448,7 +448,7 @@ 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();
|
||||||
|
|
||||||
const auto getSectionType = [&]() -> std::optional<::Settings::Type> {
|
const auto type = [&]() -> std::optional<::Settings::Type> {
|
||||||
if (section.isEmpty()) {
|
if (section.isEmpty()) {
|
||||||
return ::Settings::Main::Id();
|
return ::Settings::Main::Id();
|
||||||
} else if (section == qstr("language")) {
|
} else if (section == qstr("language")) {
|
||||||
|
@ -466,9 +466,9 @@ bool ResolveSettings(
|
||||||
return ::Settings::ChangePhone::Id();
|
return ::Settings::ChangePhone::Id();
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
};
|
}();
|
||||||
|
|
||||||
if (const auto type = getSectionType()) {
|
if (type.has_value()) {
|
||||||
controller->showSettings(*type);
|
controller->showSettings(*type);
|
||||||
controller->window().activate();
|
controller->window().activate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue