From 2941d595bd18d9a64e33b20658e007709db9afda Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 25 Dec 2004 19:03:13 +0000 Subject: Make loading the config file explicit svn-id: r16317 --- common/config-manager.cpp | 9 +++++++-- common/config-manager.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 33bb1cdfef..5bf26fbe50 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -62,7 +62,12 @@ const String falseStr("false"); ConfigManager::ConfigManager() { + // Ensure the global domain(s) are setup. + _globalDomains.addKey(kApplicationDomain); +} + +void ConfigManager::loadDefaultConfigFile() { char configFile[MAXPATHLEN]; #if defined(UNIX) if(getenv("HOME") != NULL) @@ -80,10 +85,10 @@ ConfigManager::ConfigManager() { #endif #endif - switchFile(configFile); + loadConfigFile(configFile); } -void ConfigManager::switchFile(const String &filename) { +void ConfigManager::loadConfigFile(const String &filename) { _globalDomains.clear(); _gameDomains.clear(); _transientDomain.clear(); diff --git a/common/config-manager.h b/common/config-manager.h index 5b6c27d531..8f946e26b6 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -74,7 +74,8 @@ public: /** The transient (pseudo) domain. */ static const String kTransientDomain; - void switchFile(const String &filename); + void loadDefaultConfigFile(); + void loadConfigFile(const String &filename); bool hasKey(const String &key) const; bool hasKey(const String &key, const String &dom) const; -- cgit v1.2.3