mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge pull request #8023 from jherico/settings
Eliminate extraneous writes for unchanged values
This commit is contained in:
commit
5190d8ab6b
1 changed files with 6 additions and 2 deletions
|
@ -28,7 +28,9 @@ Settings::~Settings() {
|
|||
}
|
||||
|
||||
void Settings::remove(const QString& key) {
|
||||
_manager->remove(key);
|
||||
if (key == "" || _manager->contains(key)) {
|
||||
_manager->remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
QStringList Settings::childGroups() const {
|
||||
|
@ -72,7 +74,9 @@ void Settings::endGroup() {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue