From: Elena Mamontova Date: Fri, 19 Feb 2016 14:01:35 +0000 (+0200) Subject: Ticket 26. In the reload() function modSettings vector is defined, a cycle for the X-Git-Tag: 2.409~174^2~1^2~36 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/84edd1179f8e6c275ddc919ef07781719f563309 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. --- 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()); + } + } } } }