summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2022-06-16 14:33:13 +0300
committerKatja Marttila <katja.marttila@qt.io>2022-06-17 14:27:04 +0300
commit86b8f5f5a7e11e2121b5f1181c8a049b5562789a (patch)
tree1857e45b0f0440f9ec239c32a690511d3e13ff37 /src/libs
parentba944bb90aa1d53cb372c902f7e2eede681dd700 (diff)
Fix bug when installer is not installing all required components
Several components can have dependencies to a same component. We calculate the component only once, and increase the reference count to the dependent component to keep track when it needs to be removed from install when user clicks the install tree. The dependency component was removed from install despite of the reference count. Fixing the bug so that it is truly removed from install only when there are no references to it. Task-number: QTIFW-2708 Change-Id: Ieb45270183dc948d9c58271f2d43fccfa7fb8a9f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/installercalculator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libs/installer/installercalculator.cpp b/src/libs/installer/installercalculator.cpp
index 2ef5d3b74..7528d7bd1 100644
--- a/src/libs/installer/installercalculator.cpp
+++ b/src/libs/installer/installercalculator.cpp
@@ -239,9 +239,12 @@ bool InstallerCalculator::appendComponentToInstall(Component *component, const Q
else
m_referenceCount.insert(dependencyComponentName, value);
}
- insertInstallReason(dependencyComponent, InstallerCalculator::Dependent, component->name(), true);
- if (!appendComponentToInstall(dependencyComponent, requiredDependencyVersion, revertFromInstall))
- return false;
+ if (!m_referenceCount.contains(dependencyComponentName)) {
+ insertInstallReason(dependencyComponent, InstallerCalculator::Dependent,
+ component->name(), true);
+ if (!appendComponentToInstall(dependencyComponent, requiredDependencyVersion, revertFromInstall))
+ return false;
+ }
m_visitedComponents.remove(component);
}