summaryrefslogtreecommitdiffstats
path: root/installerbuilder/libinstaller/packagemanagercore.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2011-08-18 16:15:07 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2011-08-18 16:55:14 +0200
commit2dd6ec8e42ff3c8ae056418aa7ba7f938b5e3635 (patch)
tree9acfa59b66978b9d8fe1b656ab76fe975405da5d /installerbuilder/libinstaller/packagemanagercore.cpp
parentbdce95dd1734e521f2366ff8e4dc7f26162be31d (diff)
Implement dependee resolving for uninstallation.
Change-Id: I4a31ba04dc3672961984040ea6b741f96689d41c Reviewed-on: http://codereview.qt.nokia.com/3198 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Niels Weber <niels.2.weber@nokia.com> Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/libinstaller/packagemanagercore.cpp')
-rw-r--r--installerbuilder/libinstaller/packagemanagercore.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp
index 48896e08d..fd3c7a1f8 100644
--- a/installerbuilder/libinstaller/packagemanagercore.cpp
+++ b/installerbuilder/libinstaller/packagemanagercore.cpp
@@ -899,6 +899,33 @@ QList<Component*> PackageManagerCore::orderedComponentsToInstall() const
}
/*!
+ Calculates a list of components to uninstall based on the current run mode. Auto installed dependencies
+ are resolved as well.
+*/
+bool PackageManagerCore::calculateComponentsToUninstall() const
+{
+ if (runMode() == UpdaterMode)
+ return false;
+
+ QList<Component*> components;
+ foreach (Component *component, availableComponents()) {
+ if (component->uninstallationRequested())
+ components.append(component);
+ }
+ d->m_componentsToUninstall.clear();
+ d->m_componentsToUninstallIds.clear();
+ return d->appendComponentsToUninstall(components);
+}
+
+/*!
+ Returns a list of components to uninstall. The list can be empty.
+*/
+QList<Component*> PackageManagerCore::componentsToUninstall() const
+{
+ return d->m_componentsToUninstall.toList();
+}
+
+/*!
Returns the reason why the component needs to be installed. Reasons can be: The component was scheduled
for installation, the component was added as a dependency for an other component or added as an automatic
dependency.