summaryrefslogtreecommitdiffstats
path: root/src/Common/ConfigManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/ConfigManager.cpp')
-rw-r--r--src/Common/ConfigManager.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Common/ConfigManager.cpp b/src/Common/ConfigManager.cpp
index fbd73ea..20a6110 100644
--- a/src/Common/ConfigManager.cpp
+++ b/src/Common/ConfigManager.cpp
@@ -31,16 +31,16 @@ namespace Common {
ConfigManager ConfigManager::configManager;
-void ConfigManager::handleConfigEntry(const std::vector<std::string> &entry, const std::vector<std::vector<std::string> > &section) {
+void ConfigManager::handleConfigEntry(const std::vector<std::vector<std::string> > &entry) {
bool handled = false;
for(std::set<Configurable*>::iterator c = configurables.begin(); c != configurables.end(); ++c) {
- if((*c)->handleConfigEntry(entry, section))
+ if((*c)->handleConfigEntry(entry))
handled = true;
}
if(!handled)
- Logger::logf(Logger::WARNING, "Unknown config option '%s'.", entry.front().c_str());
+ Logger::logf(Logger::WARNING, "Invalid config option '%s'.", entry.back().front().c_str());
}
bool ConfigManager::loadFile(const std::string &filename, bool finish) {
@@ -87,15 +87,15 @@ bool ConfigManager::loadFile(const std::string &filename, bool finish) {
if(pos == std::string::npos) {
entry.push_back(line);
-
- handleConfigEntry(entry, section);
}
else {
entry.push_back(line.substr(0, pos));
entry.push_back(Util::trim(line.substr(pos)));
-
- handleConfigEntry(entry, section);
}
+
+ section.push_back(entry);
+ handleConfigEntry(section);
+ section.pop_back();
}
switch(bracket) {