mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
Eliminate extraneous writes for unchanged values
This commit is contained in:
parent
65d8f65ed7
commit
bc81f00dc7
1 changed files with 6 additions and 2 deletions
|
@ -28,7 +28,9 @@ Settings::~Settings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::remove(const QString& key) {
|
void Settings::remove(const QString& key) {
|
||||||
_manager->remove(key);
|
if (key == "" || _manager->contains(key)) {
|
||||||
|
_manager->remove(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Settings::childGroups() const {
|
QStringList Settings::childGroups() const {
|
||||||
|
@ -72,7 +74,9 @@ void Settings::endGroup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setValue(const QString& name, const QVariant& value) {
|
void Settings::setValue(const QString& name, const QVariant& value) {
|
||||||
_manager->setValue(name, value);
|
if (_manager->value(name) != value) {
|
||||||
|
_manager->setValue(name, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant Settings::value(const QString& name, const QVariant& defaultValue) const {
|
QVariant Settings::value(const QString& name, const QVariant& defaultValue) const {
|
||||||
|
|
Loading…
Reference in a new issue