mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 23:17:08 +02:00
make Settings::remove() work for groups
This commit is contained in:
parent
0fb9ef947a
commit
a871613f84
1 changed files with 5 additions and 3 deletions
|
@ -28,9 +28,10 @@ QString Settings::fileName() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::remove(const QString& key) {
|
void Settings::remove(const QString& key) {
|
||||||
if (key == "" || _manager->contains(key)) {
|
// NOTE: you can't check _manager->contains(key) here because it will return 'false'
|
||||||
_manager->remove(key);
|
// when the key is a valid child group with child keys.
|
||||||
}
|
// However, calling remove() without checking will do the right thing.
|
||||||
|
_manager->remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Settings::childGroups() const {
|
QStringList Settings::childGroups() const {
|
||||||
|
@ -46,6 +47,7 @@ QStringList Settings::allKeys() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::contains(const QString& key) const {
|
bool Settings::contains(const QString& key) const {
|
||||||
|
// NOTE: this will return 'false' if key is a valid child group with child keys.
|
||||||
return _manager->contains(key);
|
return _manager->contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue