mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +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) {
|
||||
if (key == "" || _manager->contains(key)) {
|
||||
_manager->remove(key);
|
||||
}
|
||||
// NOTE: you can't check _manager->contains(key) here because it will return 'false'
|
||||
// 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 {
|
||||
|
@ -46,6 +47,7 @@ QStringList Settings::allKeys() 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue