diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-08-16 13:50:24 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-08-21 09:17:27 +0000 |
commit | 240aff88ab971fb27eb9d55e9cfc17dc77ade022 (patch) | |
tree | d8154630e00420d03814b528f08828565d85d411 /src/libs/extensionsystem/pluginspec.cpp | |
parent | 03dce9a65fc376a7688867ebb71df4d725b12b87 (diff) |
Fix that plugins were wrongly indirectly enabled when testing
Since the disabling of all plugins except tested onces was implemented
as an afterthought, it did not update the indirectly enabled plugins.
Instead, update the list of enabled/disabled plugins in the
optionsparser like for the -(no)load options, and trigger the update of
indirectly enabled plugins afterwards. Also take test dependencies into
account when indirectly enabling plugins directly.
Change-Id: I59d6c05de69a3073576155f7bd6201f1cd44697c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/extensionsystem/pluginspec.cpp')
-rw-r--r-- | src/libs/extensionsystem/pluginspec.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 8fd64007a2..98f1be8892 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -917,19 +917,25 @@ bool PluginSpecPrivate::resolveDependencies(const QList<PluginSpec *> &specs) return true; } -void PluginSpecPrivate::enableDependenciesIndirectly() +// returns the plugins that it actually indirectly enabled +QList<PluginSpec *> PluginSpecPrivate::enableDependenciesIndirectly(bool enableTestDependencies) { if (!q->isEffectivelyEnabled()) // plugin not enabled, nothing to do - return; + return {}; + QList<PluginSpec *> enabled; QHashIterator<PluginDependency, PluginSpec *> it(dependencySpecs); while (it.hasNext()) { it.next(); - if (it.key().type != PluginDependency::Required) + if (it.key().type != PluginDependency::Required + && (!enableTestDependencies || it.key().type != PluginDependency::Test)) continue; PluginSpec *dependencySpec = it.value(); - if (!dependencySpec->isEffectivelyEnabled()) + if (!dependencySpec->isEffectivelyEnabled()) { dependencySpec->d->enabledIndirectly = true; + enabled << dependencySpec; + } } + return enabled; } /*! |