78
78
+ ((format() == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
81
static QHash<QString, QHash<QString, QVariant> > settingsCache;
82
static QHash<QString, QHash<QString, SettingsChangeNotifier *> > settingsChangeNotifier;
84
inline void setCacheValue(const QString &group, const QString &key, const QVariant &data) {
85
settingsCache[group][key] = data;
87
inline const QVariant &cacheValue(const QString &group, const QString &key) {
88
return settingsCache[group][key];
90
inline bool isCached(const QString &group, const QString &key) {
91
return settingsCache.contains(group) && settingsCache[group].contains(key);
94
inline SettingsChangeNotifier *notifier(const QString &group, const QString &key) {
95
if(!hasNotifier(group, key))
96
settingsChangeNotifier[group][key] = new SettingsChangeNotifier();
97
return settingsChangeNotifier[group][key];
100
inline bool hasNotifier(const QString &group, const QString &key) {
101
return settingsChangeNotifier.contains(group) && settingsChangeNotifier[group].contains(key);
81
static QHash<QString, QVariant> settingsCache;
82
static QHash<QString, SettingsChangeNotifier *> settingsChangeNotifier;
84
inline QString normalizedKey(const QString &group, const QString &key) {
87
return group + '/' + key;
90
inline void setCacheValue(const QString &normKey, const QVariant &data) {
91
settingsCache[normKey] = data;
93
inline const QVariant &cacheValue(const QString &normKey) {
94
return settingsCache[normKey];
96
inline bool isCached(const QString &normKey) {
97
return settingsCache.contains(normKey);
100
inline SettingsChangeNotifier *notifier(const QString &normKey) {
101
if(!hasNotifier(normKey))
102
settingsChangeNotifier[normKey] = new SettingsChangeNotifier();
103
return settingsChangeNotifier[normKey];
106
inline bool hasNotifier(const QString &normKey) {
107
return settingsChangeNotifier.contains(normKey);