diff options
Diffstat (limited to 'common/config-manager.cpp')
-rw-r--r-- | common/config-manager.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 90297779d5..1619f3c295 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -300,33 +300,30 @@ bool ConfigManager::getBool(const String &key, const String &dom) const { #pragma mark - -void ConfigManager::set(const String &key, const String &value) { - // Remove the transient domain value - _transientDomain.remove(key); - - if (_activeDomain.isEmpty()) - _globalDomains[kApplicationDomain][key] = value; - else - _gameDomains[_activeDomain][key] = value; -} - void ConfigManager::set(const String &key, const String &value, const String &dom) { if (dom.isEmpty()) { - set(key, value); - return; - } + // Remove the transient domain value + _transientDomain.remove(key); + + if (_activeDomain.isEmpty()) + _globalDomains[kApplicationDomain][key] = value; + else + _gameDomains[_activeDomain][key] = value; - if (dom == kTransientDomain) - _transientDomain[key] = value; - else { - if (_globalDomains.contains(dom)) { - _globalDomains[dom][key] = value; - if (_activeDomain.isEmpty() || !_gameDomains[_activeDomain].contains(key)) - _transientDomain.remove(key); - } else { - _gameDomains[dom][key] = value; - if (dom == _activeDomain) - _transientDomain.remove(key); + } else { + + if (dom == kTransientDomain) + _transientDomain[key] = value; + else { + if (_globalDomains.contains(dom)) { + _globalDomains[dom][key] = value; + if (_activeDomain.isEmpty() || !_gameDomains[_activeDomain].contains(key)) + _transientDomain.remove(key); + } else { + _gameDomains[dom][key] = value; + if (dom == _activeDomain) + _transientDomain.remove(key); + } } } } |