Settings: reduce scope for better readability

pull/398/head
scrawl 10 years ago
parent 33019b93b4
commit fb1aa096be

@ -50,7 +50,7 @@ namespace Config
bool readFile(QTextStream &stream)
{
mCache.clear();
Map cache;
QString sectionPrefix;
@ -79,31 +79,30 @@ namespace Config
mSettings.remove(key);
QStringList values = mCache.values(key);
QStringList values = cache.values(key);
if (!values.contains(value)) {
if (mMultiValue) {
mCache.insertMulti(key, value);
cache.insertMulti(key, value);
} else {
mCache.insert(key, value);
cache.insert(key, value);
}
}
}
}
if (mSettings.isEmpty()) {
mSettings = mCache; // This is the first time we read a file
mSettings = cache; // This is the first time we read a file
return true;
}
// Merge the changed keys with those which didn't
mSettings.unite(mCache);
mSettings.unite(cache);
return true;
}
private:
Map mSettings;
Map mCache;
bool mMultiValue;
};

Loading…
Cancel
Save