diff options
author | Katja Marttila <katja.marttila@qt.io> | 2019-10-18 15:03:01 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2019-10-21 11:05:56 +0000 |
commit | 7dd35b336fbaa78e5f3b347c5e1875743d146fb0 (patch) | |
tree | 7dcc3afbcbaeb6f49ea8d3028198a2afd13970a6 /src | |
parent | 730425abb092592e4b74e2d38f5e8a0b998966f9 (diff) |
Fix addDependency functionality
addDependency was acting weird - if a subcomponent was added as
dependency, the parent was not installed. It was installed the next time
the installer was launched and something else was added/removed.
addDependency should behave the same as when selecting the component
from UI - it should install the parents too
Task-number: QTIFW-1458
Change-Id: I21726ad6acda3b1fb382263405754c2d682dea76
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/installercalculator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libs/installer/installercalculator.cpp b/src/libs/installer/installercalculator.cpp index db1f88563..a35cb99fb 100644 --- a/src/libs/installer/installercalculator.cpp +++ b/src/libs/installer/installercalculator.cpp @@ -158,6 +158,14 @@ bool InstallerCalculator::appendComponentsToInstall(const QList<Component *> &co bool InstallerCalculator::appendComponentToInstall(Component *component, const QString &version) { QSet<QString> allDependencies = component->dependencies().toSet(); + // All parents are kind of dependencies as well. If we select sub item in treeview, parent gets + // checked or partially checked as well. When adding component as dependency in script or + // config.xml we need to add the parent as dependency so the behavior is the same as in visual UI. + if (component->parentComponent() && + !allDependencies.contains(component->parentComponent()->name()) && + !m_visitedComponents.contains(component->parentComponent())) { + allDependencies.insert(component->parentComponent()->name()); + } QString requiredDependencyVersion = version; foreach (const QString &dependencyComponentName, allDependencies) { // PackageManagerCore::componentByName returns 0 if dependencyComponentName contains a |