summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/installercalculator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/installercalculator.cpp')
-rw-r--r--src/libs/installer/installercalculator.cpp8
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