helper method for closeProject()
| 980 | |
| 981 | // helper method for closeProject() |
| 982 | void 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() |
| 1010 | void ProjectController::closeAllOpenedFiles(IProject* proj) |
nothing calls this directly
no test coverage detected