diff options
Diffstat (limited to 'common/config-manager.cpp')
-rw-r--r-- | common/config-manager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index f90eefbbd3..bf9121bedd 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -299,6 +299,9 @@ void ConfigManager::set(const String &key, const String &value) { } void ConfigManager::set(const String &key, const String &value, const String &dom) { + if (dom.isEmpty()) + set(key, value); + if (_globalDomains.contains(dom)) _globalDomains[dom][key] = value; else @@ -346,24 +349,30 @@ void ConfigManager::registerDefault(const String &key, bool value) { void ConfigManager::setActiveDomain(const String &domain) { + assert(!domain.isEmpty()); _activeDomain = domain; _gameDomains.addKey(domain); } -void ConfigManager::removeGameDomain(const String &name) { - _gameDomains.remove(name); +void ConfigManager::removeGameDomain(const String &domain) { + assert(!domain.isEmpty()); + _gameDomains.remove(domain); } void ConfigManager::renameGameDomain(const String &oldName, const String &newName) { if (oldName == newName) return; + assert(!oldName.isEmpty()); + assert(!newName.isEmpty()); + _gameDomains[newName].merge(_gameDomains[oldName]); _gameDomains.remove(oldName); } bool ConfigManager::hasGameDomain(const String &domain) const { + assert(!domain.isEmpty()); return _gameDomains.contains(domain); } |