void KatePluginManager::loadConfig(KConfig *config) { // first: unload the plugins unloadAllPlugins(); /** * ask config object */ if (config) { KConfigGroup cg = KConfigGroup(config, QStringLiteral("Kate Plugins")); // disable all plugin if no config, beside the ones marked as default load for (int i = 0; i < m_pluginList.size(); ++i) { m_pluginList[i].load = cg.readEntry(m_pluginList[i].saveName(), m_pluginList[i].defaultLoad); } } /** * load plugins */ for (KatePluginList::iterator it = m_pluginList.begin(); it != m_pluginList.end(); ++it) { if (it->load) { loadPlugin(&(*it)); // restore config if (auto interface = qobject_cast<KTextEditor::SessionConfigInterface *> (it->plugin)) { KConfigGroup group(config, QString::fromLatin1("Plugin:%1:").arg(it->saveName())); interface->readSessionConfig(group); } } } }
void PluginManager::shutdown() { MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised"); MYGUI_LOG(Info, "* Shutdown: " << getClassTypeName()); unloadAllPlugins(); ResourceManager::getInstance().unregisterLoadXmlDelegate(mXmlPluginTagName); MYGUI_LOG(Info, getClassTypeName() << " successfully shutdown"); mIsInitialise = false; }
void AgentManager::loadAllPlugins() { unloadAllPlugins(); std::map<std::string,std::string> conf = getPluginConfigure(); if(!conf.empty()){ loadPluginsFromConfig(conf); }else{ OPENSDK_WARN("AgentManager", "no config use debug mode"); setDebugMode(true); } }
bool PluginManager::finish() { if (!initialized) return true; if (!unloadAllPlugins()) return false; if (!NetworkManager::_finish()) return false; initialized = false; return true; }
PluginManager::~PluginManager() { unloadAllPlugins(); }
KatePluginManager::~KatePluginManager() { // than unload the plugins unloadAllPlugins(); }
PluginCollection::~PluginCollection() { unloadAllPlugins(); delete _parser; _parser = 0L; }