mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:10:40 +02: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,8 +28,10 @@ Settings::~Settings() {
|
|||
}
|
||||
|
||||
void Settings::remove(const QString& key) {
|
||||
if (key == "" || _manager->contains(key)) {
|
||||
_manager->remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
QStringList Settings::childGroups() const {
|
||||
return _manager->childGroups();
|
||||
|
@ -72,8 +74,10 @@ void Settings::endGroup() {
|
|||
}
|
||||
|
||||
void Settings::setValue(const QString& name, const QVariant& value) {
|
||||
if (_manager->value(name) != value) {
|
||||
_manager->setValue(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant Settings::value(const QString& name, const QVariant& defaultValue) const {
|
||||
return _manager->value(name, defaultValue);
|
||||
|
|
Loading…
Reference in a new issue