s.setValue("Config/VersionMinor", versionMinor);
}
+
bool Settings::sync() {
create_qsettings;
s.sync();
}
}
+
bool Settings::isWritable() {
create_qsettings;
return s.isWritable();
}
+
QStringList Settings::allLocalKeys()
{
create_qsettings;
return cacheValue(normKey);
}
+
bool Settings::localKeyExists(const QString &key)
{
QString normKey = normalizedKey(group, key);
- if (isCached(normKey))
- return true;
-
+ // Do NOT check the cache as default values get cached, too. Otherwise loading a setting once
+ // will mark it as existing in settings, even when it only exists in cache (and not on disk).
create_qsettings;
return s.contains(normKey);
}
s.remove(key);
s.endGroup();
QString normKey = normalizedKey(group, key);
- if (isCached(normKey))
+ if (isCached(normKey)) {
settingsCache.remove(normKey);
+ }
+ if (hasNotifier(normKey)) {
+ emit notifier(normKey)->valueChanged({});
+ }
}