aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYotam Barnoy2011-01-13 11:30:37 +0000
committerYotam Barnoy2011-01-13 11:30:37 +0000
commit42c8cacde64abe526bba656491bd5c9909a7cb94 (patch)
tree64e8b84fbb5d11dc2268e0c49e77d361e4456429
parent731a75adb8ab09eff5e37bfc13cbf13914845092 (diff)
downloadscummvm-rg350-42c8cacde64abe526bba656491bd5c9909a7cb94.tar.gz
scummvm-rg350-42c8cacde64abe526bba656491bd5c9909a7cb94.tar.bz2
scummvm-rg350-42c8cacde64abe526bba656491bd5c9909a7cb94.zip
CONFIGMANAGER: small changes to support old config files with no 'gameId' keys. As discussed on -devel.
svn-id: r55222
-rw-r--r--common/config-manager.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 9f3f66f12c..a6fc67107e 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -131,6 +131,12 @@ void ConfigManager::addDomain(const Common::String &domainName, const ConfigMana
_gameDomains[domainName] = domain;
_domainSaveOrder.push_back(domainName);
+
+ // Check if we have the same misc domain. For older config files
+ // we could have 'ghost' domains with the same name, so delete
+ // the ghost domain
+ if (_miscDomains.contains(domainName))
+ _miscDomains.erase(domainName);
} else {
// Otherwise it's a miscellaneous domain
if (_miscDomains.contains(domainName))
@@ -355,10 +361,10 @@ const ConfigManager::Domain *ConfigManager::getDomain(const String &domName) con
if (domName == kKeymapperDomain)
return &_keymapperDomain;
#endif
- if (_miscDomains.contains(domName))
- return &_miscDomains[domName];
if (_gameDomains.contains(domName))
return &_gameDomains[domName];
+ if (_miscDomains.contains(domName))
+ return &_miscDomains[domName];
return 0;
}
@@ -375,10 +381,10 @@ ConfigManager::Domain *ConfigManager::getDomain(const String &domName) {
if (domName == kKeymapperDomain)
return &_keymapperDomain;
#endif
- if (_miscDomains.contains(domName))
- return &_miscDomains[domName];
if (_gameDomains.contains(domName))
return &_gameDomains[domName];
+ if (_miscDomains.contains(domName))
+ return &_miscDomains[domName];
return 0;
}