MCPcopy Create free account
hub / github.com/KDE/kdevelop / unloadUnusedProjectPlugins

Method unloadUnusedProjectPlugins

kdevplatform/shell/projectcontroller.cpp:982–1007  ·  view source on GitHub ↗

helper method for closeProject()

Source from the content-addressed store, hash-verified

980
981// helper method for closeProject()
982void ProjectController::unloadUnusedProjectPlugins(IProject* proj)
983{
984 Q_D(ProjectController);
985
986 const QList<IPlugin*> pluginsForProj = d->m_projectPlugins.value( proj );
987 d->m_projectPlugins.remove( proj );
988
989 QList<IPlugin*> otherProjectPlugins;
990 for (const QList<IPlugin*>& _list : std::as_const(d->m_projectPlugins)) {
991 otherProjectPlugins << _list;
992 }
993
994 QSet<IPlugin*> pluginsForProjSet(pluginsForProj.begin(), pluginsForProj.end());
995 QSet<IPlugin*> otherPrjPluginsSet(otherProjectPlugins.constBegin(), otherProjectPlugins.constEnd());
996 // loaded - target = tobe unloaded.
997 const QSet<IPlugin*> tobeRemoved = pluginsForProjSet.subtract( otherPrjPluginsSet );
998 for (IPlugin* _plugin : tobeRemoved) {
999 KPluginMetaData _plugInfo = Core::self()->pluginController()->pluginInfo( _plugin );
1000 if( _plugInfo.isValid() )
1001 {
1002 QString _plugName = _plugInfo.pluginId();
1003 qCDebug(SHELL) << "about to unloading :" << _plugName;
1004 Core::self()->pluginController()->unloadPlugin( _plugName );
1005 }
1006 }
1007}
1008
1009// helper method for closeProject()
1010void ProjectController::closeAllOpenedFiles(IProject* proj)

Callers

nothing calls this directly

Calls 11

constBeginMethod · 0.80
constEndMethod · 0.80
pluginControllerMethod · 0.80
pluginIdMethod · 0.80
valueMethod · 0.45
removeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
pluginInfoMethod · 0.45
isValidMethod · 0.45
unloadPluginMethod · 0.45

Tested by

no test coverage detected