mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Add folders menu to Settings.
This commit is contained in:
@@ -74,6 +74,16 @@ auto AppConfig::getValue(const QString &key, Extractor &&extractor) const {
|
||||
: MTPJSONValue(MTP_jsonNull()));
|
||||
}
|
||||
|
||||
bool AppConfig::getBool(const QString &key, bool fallback) const {
|
||||
return getValue(key, [&](const MTPJSONValue &value) {
|
||||
return value.match([&](const MTPDjsonBool &data) {
|
||||
return mtpIsTrue(data.vvalue());
|
||||
}, [&](const auto &data) {
|
||||
return fallback;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
double AppConfig::getDouble(const QString &key, double fallback) const {
|
||||
return getValue(key, [&](const MTPJSONValue &value) {
|
||||
return value.match([&](const MTPDjsonNumber &data) {
|
||||
|
Reference in New Issue
Block a user