2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Version 1.4.9: try using bare ReadOption instead of ReadBoolOption

This commit is contained in:
RadRussianRus
2022-03-08 14:15:41 +03:00
parent 30c2d45591
commit c528bf86cd

View File

@@ -80,17 +80,6 @@ bool ReadIntOption(QJsonObject obj, QString key, std::function<void(int)> callba
return (readValueResult && readResult);
}
bool ReadBoolOption(QJsonObject obj, QString key, std::function<void(bool)> callback) {
auto readResult = false;
auto readValueResult = ReadOption(obj, key, [&](QJsonValue v) {
if (v.isBool()) {
callback(v.toBool());
readResult = true;
}
});
return (readValueResult && readResult);
}
bool ReadArrayOption(QJsonObject obj, QString key, std::function<void(QJsonArray)> callback) {
auto readResult = false;
auto readValueResult = ReadOption(obj, key, [&](QJsonValue v) {
@@ -175,8 +164,8 @@ LocalFolder MakeLocalFolder(const QJsonObject &obj) {
});
for (const auto &[flag, option] : LocalFolderSettingsFlags) {
ReadBoolOption(obj, option, [&](auto v) {
if (v) {
ReadOption(obj, option, [&](auto v) {
if (v.isBool() && v.toBool()) {
result.flags |= flag;
}
});