aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/extensionsystem/pluginspec.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-01-04 06:23:32 +0100
committerEike Ziller <eike.ziller@qt.io>2017-01-09 12:25:08 +0000
commit284fa63be2b2af4d16926bc7cc17ca30cf0b5e39 (patch)
tree2bc8424f485c8ec84a6836d4d7d09153714f3f92 /src/libs/extensionsystem/pluginspec.cpp
parentb29513aa5b63c3abfef79e928bc803f471663eb4 (diff)
Support 'hidden' plugins
Plugins can be hidden in the "About Plugins" view by default. Users can still make them all visible, but the default view can be made less noisy by hiding plugins that only exist as a base for other plugins. Plugins that can not run on the current platform are hidden by default as well. Change-Id: Iaf2f751c4ea4b3afc605bbbea6611eea042e62c7 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs/extensionsystem/pluginspec.cpp')
-rw-r--r--src/libs/extensionsystem/pluginspec.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp
index 61e2fb0451..c839b8ea3f 100644
--- a/src/libs/extensionsystem/pluginspec.cpp
+++ b/src/libs/extensionsystem/pluginspec.cpp
@@ -277,6 +277,11 @@ bool PluginSpec::isRequired() const
return d->required;
}
+bool PluginSpec::isHiddenByDefault() const
+{
+ return d->hiddenByDefault;
+}
+
/*!
Returns whether the plugin has its experimental flag set.
*/
@@ -482,6 +487,7 @@ namespace {
const char PLUGIN_VERSION[] = "Version";
const char PLUGIN_COMPATVERSION[] = "CompatVersion";
const char PLUGIN_REQUIRED[] = "Required";
+ const char PLUGIN_HIDDEN_BY_DEFAULT[] = "HiddenByDefault";
const char PLUGIN_EXPERIMENTAL[] = "Experimental";
const char PLUGIN_DISABLED_BY_DEFAULT[] = "DisabledByDefault";
const char VENDOR[] = "Vendor";
@@ -692,6 +698,12 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &metaData)
required = value.toBool(false);
qCDebug(pluginLog) << "required =" << required;
+ value = pluginInfo.value(QLatin1String(PLUGIN_HIDDEN_BY_DEFAULT));
+ if (!value.isUndefined() && !value.isBool())
+ return reportError(msgValueIsNotABool(PLUGIN_HIDDEN_BY_DEFAULT));
+ hiddenByDefault = value.toBool(false);
+ qCDebug(pluginLog) << "hiddenByDefault =" << hiddenByDefault;
+
value = pluginInfo.value(QLatin1String(PLUGIN_EXPERIMENTAL));
if (!value.isUndefined() && !value.isBool())
return reportError(msgValueIsNotABool(PLUGIN_EXPERIMENTAL));