aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-10-09 11:42:59 +0000
committerMax Horn2003-10-09 11:42:59 +0000
commit21480a2289f216e38b872ceb038d3e661d4a01ce (patch)
treec96aa2ce05a6af9d565594a7c61016eff110e4be
parente53923eedac8db01f32bf106cb523a747e898780 (diff)
downloadscummvm-rg350-21480a2289f216e38b872ceb038d3e661d4a01ce.tar.gz
scummvm-rg350-21480a2289f216e38b872ceb038d3e661d4a01ce.tar.bz2
scummvm-rg350-21480a2289f216e38b872ceb038d3e661d4a01ce.zip
fix ConfMan.set when dom is empty; added some asserts (paranoia)
svn-id: r10698
-rw-r--r--common/config-manager.cpp13
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);
}