From 84edd1179f8e6c275ddc919ef07781719f563309 Mon Sep 17 00:00:00 2001 From: Elena Mamontova Date: Fri, 19 Feb 2016 16:01:35 +0200 Subject: [PATCH] Ticket 26. In the reload() function modSettings vector is defined, a cycle for the modSettins vector is added, the modSettings[j] parameter is added in the m_modules[i]->Reload() function. --- projects/stargazer/plugin_mgr.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/projects/stargazer/plugin_mgr.cpp b/projects/stargazer/plugin_mgr.cpp index d3430c89..b7ead90d 100644 --- a/projects/stargazer/plugin_mgr.cpp +++ b/projects/stargazer/plugin_mgr.cpp @@ -121,15 +121,22 @@ PluginManager::~PluginManager() void PluginManager::reload(const SETTINGS_IMPL& settings) { + const std::vector & modSettings(settings.GetModulesSettings()); for (size_t i = 0; i < m_modules.size(); ++i) { - PLUGIN & plugin = m_modules[i]->GetPlugin(); - if (m_modules[i]->Reload()) + for (size_t j = 0; j < modSettings.size(); j++) { - m_log("Error reloading module '%s': '%s'", plugin.GetVersion().c_str(), - plugin.GetStrError().c_str()); - printfd(__FILE__, "Error reloading module '%s': '%s'\n", plugin.GetVersion().c_str(), - plugin.GetStrError().c_str()); + if (modSettings[j].moduleName == m_modules[i]->GetName()) + { + PLUGIN & plugin = m_modules[i]->GetPlugin(); + if (m_modules[i]->Reload(modSettings[j])) + { + m_log("Error reloading module '%s': '%s'", plugin.GetVersion().c_str(), + plugin.GetStrError().c_str()); + printfd(__FILE__, "Error reloading module '%s': '%s'\n", plugin.GetVersion().c_str(), + plugin.GetStrError().c_str()); + } + } } } } -- 2.44.2