Make it possible for installers to disable plugins by default.

Plugin manager reads Plugins/Ignored in installation global settings
now, and handles these plugins similar to as if they were experimental.

Change-Id: I56a0c5fe143e3fbd9261244bafece26d7b99c154
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@nokia.com>
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
Eike Ziller
2011-10-26 14:46:29 +02:00
parent 28039af902
commit 2ee0b36342
8 changed files with 79 additions and 14 deletions

View File

@@ -275,6 +275,16 @@ bool PluginSpec::isExperimental() const
return d->experimental;
}
/*!
Returns if the plugin is disabled by default.
This might be because the plugin is experimental, or because
the plugin manager's settings define it as disabled by default.
*/
bool PluginSpec::isDisabledByDefault() const
{
return d->disabledByDefault;
}
/*!
\fn bool PluginSpec::isEnabled() const
Returns if the plugin is loaded at startup. True by default - the user can change it from the Plugin settings.
@@ -458,6 +468,8 @@ namespace {
*/
PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec)
:
experimental(false),
disabledByDefault(false),
enabled(true),
disabledIndirectly(false),
plugin(0),
@@ -521,6 +533,11 @@ void PluginSpec::setEnabled(bool value)
d->enabled = value;
}
void PluginSpec::setDisabledByDefault(bool value)
{
d->disabledByDefault = value;
}
void PluginSpec::setDisabledIndirectly(bool value)
{
d->disabledIndirectly = value;
@@ -601,6 +618,7 @@ void PluginSpecPrivate::readPluginSpec(QXmlStreamReader &reader)
reader.raiseError(msgInvalidFormat(PLUGIN_EXPERIMENTAL));
return;
}
disabledByDefault = experimental;
enabled = !experimental;
while (!reader.atEnd()) {
reader.readNext();