aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJames Brown2004-02-07 04:53:59 +0000
committerJames Brown2004-02-07 04:53:59 +0000
commit9b97d851fe7caef9c6c87ec5a073f44060112b9c (patch)
tree4078f6a0bbed03596af3da67b6a63615984ddd21 /common
parenta2039576fb698d50c6459d7f2ea66804dcbd33d6 (diff)
downloadscummvm-rg350-9b97d851fe7caef9c6c87ec5a073f44060112b9c.tar.gz
scummvm-rg350-9b97d851fe7caef9c6c87ec5a073f44060112b9c.tar.bz2
scummvm-rg350-9b97d851fe7caef9c6c87ec5a073f44060112b9c.zip
Add -c/--config option to specific alternate configuration file. Sorry Max, but it's damn useful for coverdiscs :)
svn-id: r12758
Diffstat (limited to 'common')
-rw-r--r--common/config-manager.cpp11
-rw-r--r--common/config-manager.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 299d3c817e..46881ecde3 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -86,6 +86,14 @@ ConfigManager::ConfigManager() {
#endif
#endif
+ switchFile(configFile);
+}
+
+void ConfigManager::switchFile(const String &filename) {
+ _globalDomains.clear();
+ _gameDomains.clear();
+ _transientDomain.clear();
+
// Ensure the global domain(s) are setup.
_globalDomains.addKey(kApplicationDomain);
#ifdef _WIN32_WCE
@@ -94,8 +102,9 @@ ConfigManager::ConfigManager() {
_globalDomains.addKey("smartfon-keys");
#endif
- _filename = configFile;
+ _filename = filename;
loadFile(_filename);
+ printf("Switched to configuration %s\n", _filename.c_str());
}
void ConfigManager::loadFile(const String &filename) {
diff --git a/common/config-manager.h b/common/config-manager.h
index ddc97b76ee..ee3159fb0a 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -61,6 +61,8 @@ public:
/** The transient (pseudo) domain. */
static const String kTransientDomain;
+ void switchFile(const String &filename);
+
bool hasKey(const String &key) const;
bool hasKey(const String &key, const String &dom) const;