summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/componentmodel.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-11-10 12:31:08 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-11-11 09:39:19 +0200
commit2f2a7c52ebf172cf1462121f8b35d016dde2adde (patch)
tree88963ffbdd8ce643f8e11750e58095019765df3e /src/libs/installer/componentmodel.cpp
parent785007b6bc1fed0a74dabcd377c6514fcbc5e87d (diff)
Fix enabled navigation buttons while metadata fetch is still in progress
This allowed the user to erroneously proceed forward with the installation even when the metadata fetch for newly selected categories was not finished. Task-number: QTIFW-2849 Change-Id: If552b85b3aa8c3ee9246328f12a72fbdaba8b797 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-rw-r--r--src/libs/installer/componentmodel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index e60ba92ae..8407e5f2d 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -47,6 +47,8 @@ namespace QInstaller {
This enum value holds the checked state of the components available for
installation.
+ \value Empty
+ The model does not contain any components.
\value AllChecked
All components are checked.
\value AllUnchecked
@@ -400,7 +402,7 @@ void ComponentModel::reset(QList<Component *> rootComponents)
m_uncheckable.clear();
m_indexByNameCache.clear();
m_rootComponentList.clear();
- m_modelState = DefaultChecked;
+ m_modelState = !rootComponents.isEmpty() ? DefaultChecked : Empty;
// Initialize these with an empty set for every possible state, cause we compare the hashes later in
// updateAndEmitModelState(). The comparison than might lead to wrong results if one of the checked
@@ -491,6 +493,10 @@ void ComponentModel::postModelReset()
void ComponentModel::updateModelState()
{
+ if (m_rootComponentList.isEmpty()) {
+ m_modelState = ComponentModel::Empty;
+ return;
+ }
m_modelState = ComponentModel::DefaultChecked;
if (m_initialCheckedState != m_currentCheckedState)
m_modelState = ComponentModel::PartiallyChecked;