+ static QHash<QString, QVariant> settingsCache;
+ static QHash<QString, SettingsChangeNotifier *> settingsChangeNotifier;
+
+ inline QString normalizedKey(const QString &group, const QString &key)
+ {
+ if (group.isEmpty())
+ return key;
+ return group + '/' + key;
+ }
+
+
+ inline void setCacheValue(const QString &normKey, const QVariant &data)
+ {
+ settingsCache[normKey] = data;
+ }
+
+
+ inline const QVariant &cacheValue(const QString &normKey)
+ {
+ return settingsCache[normKey];
+ }
+
+
+ inline bool isCached(const QString &normKey)
+ {
+ return settingsCache.contains(normKey);
+ }
+
+
+ inline SettingsChangeNotifier *notifier(const QString &normKey)
+ {
+ if (!hasNotifier(normKey))
+ settingsChangeNotifier[normKey] = new SettingsChangeNotifier();
+ return settingsChangeNotifier[normKey];
+ }
+
+
+ inline bool hasNotifier(const QString &normKey)
+ {
+ return settingsChangeNotifier.contains(normKey);
+ }
+};