Example #1
0
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);
  }
}
Example #2
0
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({});
    }
}
Example #3
0
SettingsChangeNotifier* Settings::notifier(const QString& normKey) const
{
    if (!hasNotifier(normKey))
        _settingsChangeNotifier[normKey] = std::make_shared<SettingsChangeNotifier>();
    return _settingsChangeNotifier[normKey].get();
}