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

Method resetToDefaults

kdevplatform/shell/plugincontroller.cpp:873–900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873void PluginController::resetToDefaults()
874{
875 Q_D(PluginController);
876
877 KSharedConfigPtr cfg = Core::self()->activeSession()->config();
878 cfg->deleteGroup( KEY_Plugins() );
879 cfg->sync();
880 KConfigGroup grp = cfg->group( KEY_Plugins() );
881 QStringList plugins = ShellExtension::getInstance()->defaultPlugins();
882 if( plugins.isEmpty() )
883 {
884 for (const KPluginMetaData& info : std::as_const(d->plugins)) {
885 if (!isUserSelectable(info)) {
886 continue;
887 }
888
889 QJsonValue enabledByDefault = info.rawData()[KEY_KPlugin()].toObject()[KEY_EnabledByDefault()];
890 // plugins enabled until explicitly specified otherwise
891 if (enabledByDefault.isNull() || enabledByDefault.toBool()) {
892 plugins << info.pluginId();
893 }
894 }
895 }
896 for (const QString& s : std::as_const(plugins)) {
897 grp.writeEntry(s + KEY_Suffix_Enabled(), true);
898 }
899 grp.sync();
900}
901
902}
903

Callers 1

defaultsMethod · 0.80

Calls 12

KEY_PluginsFunction · 0.85
isUserSelectableFunction · 0.85
KEY_KPluginFunction · 0.85
KEY_EnabledByDefaultFunction · 0.85
KEY_Suffix_EnabledFunction · 0.85
defaultPluginsMethod · 0.80
isNullMethod · 0.80
pluginIdMethod · 0.80
writeEntryMethod · 0.80
configMethod · 0.45
activeSessionMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected