diff options
Diffstat (limited to 'src/Common/ModuleManager.cpp')
-rw-r--r-- | src/Common/ModuleManager.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/Common/ModuleManager.cpp b/src/Common/ModuleManager.cpp index be25f9e..c119eab 100644 --- a/src/Common/ModuleManager.cpp +++ b/src/Common/ModuleManager.cpp @@ -58,18 +58,12 @@ ModuleManager::~ModuleManager() { } } -bool ModuleManager::handleConfigEntry(const Core::ConfigEntry &entry, bool handled) { - if(handled) - return false; - - if(entry[0].getKey().matches("LoadModule") && entry[1].isEmpty()) { - if(!loadModule(entry[0][0].toLocale())) - application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].toLocale().c_str()); - - return true; +void ModuleManager::configure() { + std::vector<const Core::ConfigEntry*> entries = application->getConfigManager()->getEntries("LoadModule"); + for(std::vector<const Core::ConfigEntry*>::iterator entry = entries.begin(); entry != entries.end(); ++entry) { + if(!loadModule((*entry)->getValue().toLocale())) + application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", (*entry)->getValue().toLocale().c_str()); } - - return false; } bool ModuleManager::loadModule(const std::string &name) { |