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

Method enabledState

kdevplatform/shell/plugincontroller.cpp:266–286  ·  view source on GitHub ↗

* Estimate enabled state of a plugin */

Source from the content-addressed store, hash-verified

264 * Estimate enabled state of a plugin
265 */
266 EnableState enabledState(const KPluginMetaData& info) const
267 {
268 // first check black listing from environment
269 static const QStringList disabledPlugins = QString::fromLatin1(qgetenv("KDEV_DISABLE_PLUGINS")).split(QLatin1Char(';'));
270 if (disabledPlugins.contains(info.pluginId())) {
271 return DisabledByEnv;
272 }
273
274 if (!isUserSelectable( info ))
275 return AlwaysEnabled;
276
277 // read stored user preference
278 const KConfigGroup grp = Core::self()->activeSession()->config()->group( KEY_Plugins() );
279 const QString pluginEnabledKey = info.pluginId() + KEY_Suffix_Enabled();
280 if (grp.hasKey(pluginEnabledKey)) {
281 return grp.readEntry(pluginEnabledKey, true) ? EnabledBySetting : DisabledBySetting;
282 }
283
284 // should not happen
285 return DisabledByUnknown;
286 }
287
288 /**
289 * Decide whether a plugin is enabled

Callers 1

loadPluginInternalMethod · 0.80

Calls 10

isUserSelectableFunction · 0.85
KEY_PluginsFunction · 0.85
KEY_Suffix_EnabledFunction · 0.85
pluginIdMethod · 0.80
readEntryMethod · 0.80
splitMethod · 0.45
containsMethod · 0.45
configMethod · 0.45
activeSessionMethod · 0.45
hasKeyMethod · 0.45

Tested by

no test coverage detected