summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2019-07-03 11:36:36 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2019-08-15 10:00:10 +0000
commit120e527ed16f6c579e46f71c9018ad35ad1cb528 (patch)
tree609ede03a9275d37f7c746e3f2d71fbfd28b4c1a
parent1ae7ad5c68da3789f771427ce4b2571430a8883d (diff)
Fix recalculation of components to install in MaintenanceTool
In MaintenanceTool, navigating back and forth in "Update" and "Add or remove components" doesn't cause update in components to install and uninstall information. Without changing component model's state by checking/unchecking components the recalculating is not done and performing the opposite maintainer action causes unintended results. Make IFW recalculate components to install when leaving component selection page so InstallerCalculator and UninstallerCalculator's state is correct even without changing the component selection. Task-number: QTIFW-694 Change-Id: I89abd9a1952fe30d1e3ae4012e7a7bac68793a89 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r--src/libs/installer/componentselectionpage_p.cpp4
-rw-r--r--src/libs/installer/packagemanagercore.cpp8
-rw-r--r--src/libs/installer/packagemanagercore.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp
index 88ea86b8a..84349e4ad 100644
--- a/src/libs/installer/componentselectionpage_p.cpp
+++ b/src/libs/installer/componentselectionpage_p.cpp
@@ -147,6 +147,10 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP
m_treeViewVLayout->addWidget(m_treeView, 3);
+ // force a recalculation of components to install to keep the state correct
+ connect(q, &ComponentSelectionPage::left,
+ m_core, &PackageManagerCore::clearComponentsToInstallCalculated);
+
m_mainHLayout = new QHBoxLayout(q);
m_mainHLayout->addLayout(m_treeViewVLayout, 3);
m_mainHLayout->addLayout(m_descriptionVLayout, 2);
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index f23afd76e..028a5b4b2 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -537,6 +537,14 @@ void PackageManagerCore::componentsToInstallNeedsRecalculation()
}
/*!
+ \sa {installer::clearComponentsToInstallCalculated}{installer.clearComponentsToInstallCalculated}
+ */
+void PackageManagerCore::clearComponentsToInstallCalculated()
+{
+ d->m_componentsToInstallCalculated = false;
+}
+
+/*!
\sa {installer::autoAcceptMessageBoxes}{installer.autoAcceptMessageBoxes}
\sa autoRejectMessageBoxes(), setMessageBoxAutomaticAnswer()
*/
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index 809994cfe..f4240fde0 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -293,6 +293,7 @@ public Q_SLOTS:
void setCompleteUninstallation(bool complete);
void cancelMetaInfoJob();
void componentsToInstallNeedsRecalculation();
+ void clearComponentsToInstallCalculated();
Q_SIGNALS:
void aboutCalculateComponentsToInstall() const;