void Settings::setLocalValue(const QString &key, const QVariant &data) { QString normKey = normalizedKey(group, key); create_qsettings; s.setValue(normKey, data); setCacheValue(normKey, data); if(hasNotifier(normKey)) { emit notifier(normKey)->valueChanged(data); } }
void Settings::removeLocalKey(const QString &key) { create_qsettings; s.beginGroup(group); s.remove(key); s.endGroup(); QString normKey = normalizedKey(group, key); if (isCached(normKey)) { settingsCache.remove(normKey); } if (hasNotifier(normKey)) { emit notifier(normKey)->valueChanged({}); } }
SettingsChangeNotifier* Settings::notifier(const QString& normKey) const { if (!hasNotifier(normKey)) _settingsChangeNotifier[normKey] = std::make_shared<SettingsChangeNotifier>(); return _settingsChangeNotifier[normKey].get(); }