* Estimate enabled state of a plugin */
| 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 |
no test coverage detected