diff options
author | Yotam Barnoy | 2011-01-13 11:30:37 +0000 |
---|---|---|
committer | Yotam Barnoy | 2011-01-13 11:30:37 +0000 |
commit | 42c8cacde64abe526bba656491bd5c9909a7cb94 (patch) | |
tree | 64e8b84fbb5d11dc2268e0c49e77d361e4456429 | |
parent | 731a75adb8ab09eff5e37bfc13cbf13914845092 (diff) | |
download | scummvm-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.cpp | 14 |
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; } |