diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-27 15:24:46 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-27 15:10:25 +0000 |
commit | 986bb1d89785ad52d791db51199aa31b465521a3 (patch) | |
tree | aa5ba7b6b694862ccd11ed8bf34ff4e60f4b38bf /src | |
parent | be868049c6c8ee0e8e9ff27e9c2c00330f143c77 (diff) |
Restore original behavior for component.installationRequested
component.installationRequested() should return true also for
components that are selected through dependencies (after they
have been resolved). This restores the original behavior on 1.6.
To keep the change minimal the 'new' behavior has been saved
in a method isSelectedForInstallation . This should be further
refactored in the master branch.
Task-number: QTBUG-633
Change-Id: I2cb936a399927252a4ad4dd81f73683fa3c28a01
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/component.cpp | 7 | ||||
-rw-r--r-- | src/libs/installer/component.h | 1 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 2 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index fc689f911..03810bf97 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -1263,6 +1263,11 @@ bool Component::isInstalled() const */ bool Component::installationRequested() const { + return installAction() == Install; +} + +bool Component::isSelectedForInstallation() const +{ return !isInstalled() && isSelected(); } @@ -1293,7 +1298,7 @@ bool Component::updateRequested() */ bool Component::componentChangeRequested() { - return updateRequested() || installationRequested() || uninstallationRequested(); + return updateRequested() || isSelectedForInstallation() || uninstallationRequested(); } diff --git a/src/libs/installer/component.h b/src/libs/installer/component.h index b8e4e93b1..3382dcf0d 100644 --- a/src/libs/installer/component.h +++ b/src/libs/installer/component.h @@ -180,6 +180,7 @@ public: Q_INVOKABLE void setInstalled(); Q_INVOKABLE bool isInstalled() const; Q_INVOKABLE bool installationRequested() const; + bool isSelectedForInstallation() const; Q_INVOKABLE void setUninstalled(); Q_INVOKABLE bool isUninstalled() const; diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 4af1fa658..821b10515 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -1283,7 +1283,7 @@ QList<Component *> PackageManagerCore::componentsMarkedForInstallation() const foreach (Component *component, relevant) { // ask for all components which will be installed to get all dependencies // even dependencies which are changed without an increased version - if (component->installationRequested() + if (component->isSelectedForInstallation() || (component->isInstalled() && !component->uninstallationRequested())) { markedForInstallation.append(component); diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 5717eebca..ebaf4d92c 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1665,7 +1665,7 @@ bool PackageManagerCorePrivate::runPackageUpdater() // There is a replacement, but the replacement is not scheduled for update, keep it as well. if (m_componentsToReplaceAllMode.contains(name) - && !m_componentsToReplaceAllMode.value(name).first->installationRequested()) { + && !m_componentsToReplaceAllMode.value(name).first->isSelectedForInstallation()) { nonRevertedOperations.append(operation); continue; } |