aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/config-manager.cpp12
-rw-r--r--common/config-manager.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 2ee1c20ced..dc29cec8c9 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -239,6 +239,18 @@ bool ConfigManager::hasKey(const String &key, const String &dom) const {
}
+void ConfigManager::removeKey(const String &key, const String &dom) {
+ assert(!dom.isEmpty());
+
+ if (_gameDomains.contains(dom))
+ _gameDomains[dom].remove(key);
+ else if (_globalDomains.contains(dom))
+ _globalDomains[dom].remove(key);
+ else
+ error("Removing key '%s' from non-existant domain '%s'", key.c_str(), dom.c_str());
+}
+
+
#pragma mark -
diff --git a/common/config-manager.h b/common/config-manager.h
index bede2a3529..8147df5ebd 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -63,6 +63,8 @@ public:
bool hasKey(const String &key) const;
bool hasKey(const String &key, const String &dom) const;
+ void removeKey(const String &key, const String &dom);
+
const String & get(const String &key) const;
const String & get(const String &key, const String &dom) const;
int getInt(const String &key, const String &dom = String::emptyString) const;