forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user