2
0
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:
John Preston
2020-03-18 14:07:11 +04:00
parent 4881981cf6
commit ffc65f7da4
13 changed files with 54 additions and 5 deletions

View File

@@ -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) {