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

Method updateLoadedPlugins

kdevplatform/shell/plugincontroller.cpp:846–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844}
845
846void PluginController::updateLoadedPlugins()
847{
848 Q_D(PluginController);
849
850 QStringList defaultPlugins = ShellExtension::getInstance()->defaultPlugins();
851 KConfigGroup grp = Core::self()->activeSession()->config()->group( KEY_Plugins() );
852 for (const KPluginMetaData& info : std::as_const(d->plugins)) {
853 if( isGlobalPlugin( info ) )
854 {
855 bool enabled = grp.readEntry(info.pluginId() + KEY_Suffix_Enabled(), ( defaultPlugins.isEmpty() || defaultPlugins.contains( info.pluginId() ) ) ) || !isUserSelectable( info );
856 bool loaded = d->loadedPlugins.contains( info );
857 if( loaded && !enabled )
858 {
859 qCDebug(SHELL) << "unloading" << info.pluginId();
860 if( !unloadPlugin( info.pluginId() ) )
861 {
862 grp.writeEntry( info.pluginId() + KEY_Suffix_Enabled(), false );
863 }
864 } else if( !loaded && enabled )
865 {
866 loadPluginInternal( info.pluginId() );
867 }
868 }
869 // TODO: what about project plugins? what about dependency plugins?
870 }
871}
872
873void PluginController::resetToDefaults()
874{

Callers 1

applyMethod · 0.80

Calls 12

KEY_PluginsFunction · 0.85
isGlobalPluginFunction · 0.85
KEY_Suffix_EnabledFunction · 0.85
isUserSelectableFunction · 0.85
defaultPluginsMethod · 0.80
readEntryMethod · 0.80
pluginIdMethod · 0.80
writeEntryMethod · 0.80
configMethod · 0.45
activeSessionMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected