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>
This commit is contained in:
Arttu Tarkiainen 2019-07-03 11:36:36 +03:00
parent 1ae7ad5c68
commit 120e527ed1
3 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -536,6 +536,14 @@ void PackageManagerCore::componentsToInstallNeedsRecalculation()
component->updateUncompressedSize(); // this is a recursive call
}
/*!
\sa {installer::clearComponentsToInstallCalculated}{installer.clearComponentsToInstallCalculated}
*/
void PackageManagerCore::clearComponentsToInstallCalculated()
{
d->m_componentsToInstallCalculated = false;
}
/*!
\sa {installer::autoAcceptMessageBoxes}{installer.autoAcceptMessageBoxes}
\sa autoRejectMessageBoxes(), setMessageBoxAutomaticAnswer()

View File

@ -293,6 +293,7 @@ public Q_SLOTS:
void setCompleteUninstallation(bool complete);
void cancelMetaInfoJob();
void componentsToInstallNeedsRecalculation();
void clearComponentsToInstallCalculated();
Q_SIGNALS:
void aboutCalculateComponentsToInstall() const;