diff --git a/Telegram/SourceFiles/kotato/json_settings.cpp b/Telegram/SourceFiles/kotato/json_settings.cpp index 99701f178..0ea35e449 100644 --- a/Telegram/SourceFiles/kotato/json_settings.cpp +++ b/Telegram/SourceFiles/kotato/json_settings.cpp @@ -146,6 +146,17 @@ bool ReadStringOption(QJsonObject obj, QString key, std::function return (readValueResult && readResult); } +bool ReadDoubleOption(QJsonObject obj, QString key, std::function callback) { + auto readResult = false; + auto readValueResult = ReadOption(obj, key, [&](QJsonValue v) { + if (v.isDouble()) { + callback(v.toDouble()); + readResult = true; + } + }); + return (readValueResult && readResult); +} + bool ReadIntOption(QJsonObject obj, QString key, std::function callback) { auto readResult = false; auto readValueResult = ReadOption(obj, key, [&](QJsonValue v) {