summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/installer/component_p.h3
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp4
-rw-r--r--src/libs/installer/uninstallercalculator.cpp9
3 files changed, 11 insertions, 5 deletions
diff --git a/src/libs/installer/component_p.h b/src/libs/installer/component_p.h
index 9a5d0fd20..f6e9ac2bb 100644
--- a/src/libs/installer/component_p.h
+++ b/src/libs/installer/component_p.h
@@ -98,7 +98,8 @@ public:
Install,
Uninstall,
KeepInstalled,
- KeepUninstalled
+ KeepUninstalled,
+ AutodependUninstallation
};
enum Column {
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index b21b32832..1cd7811c7 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -378,11 +378,15 @@ bool PackageManagerCorePrivate::buildComponentTree(QHash<QString, Component*> &c
// now we can preselect components in the tree
foreach (QInstaller::Component *component, components) {
// set the checked state for all components without child (means without tristate)
+ // set checked state also for installed virtual tristate componets as otherwise
+ // those will be uninstalled
if (component->isCheckable() && !component->isTristate()) {
if (component->isDefault() && isInstaller())
component->setCheckState(Qt::Checked);
else if (component->isInstalled())
component->setCheckState(Qt::Checked);
+ } else if (component->isVirtual() && component->isInstalled() && component->isTristate()) {
+ component->setCheckState(Qt::Checked);
}
}
diff --git a/src/libs/installer/uninstallercalculator.cpp b/src/libs/installer/uninstallercalculator.cpp
index 5d49d37dc..597c7902f 100644
--- a/src/libs/installer/uninstallercalculator.cpp
+++ b/src/libs/installer/uninstallercalculator.cpp
@@ -103,16 +103,17 @@ void UninstallerCalculator::appendComponentsToUninstall(const QList<Component*>
Component *cc = PackageManagerCore::componentByName(possibleName, m_installedComponents);
if (!cc->uninstallationRequested()) {
- autoDependencies.removeAll(possibleName);
+ if (cc->installAction() != ComponentModelHelper::AutodependUninstallation) {
+ autoDependencies.removeAll(possibleName);
+ }
}
}
}
- // A component requested auto installation, keep it to resolve their dependencies as well.
- // Mark it unchecked for their dependencies to know that the component is marked for uninstallation.
+ // A component requested auto uninstallation, keep it to resolve their dependencies as well.
if (!autoDependencies.isEmpty()) {
autoDependOnList.append(component);
- component->setCheckState(Qt::Unchecked);
+ component->setInstallAction(ComponentModelHelper::AutodependUninstallation);
}
}
}