summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/componentmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-rw-r--r--src/libs/installer/componentmodel.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index 5285154f6..080e84d85 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -325,10 +325,16 @@ void ComponentModel::setRootComponents(QList<QInstaller::Component*> rootCompone
m_uncheckable.clear();
m_indexByNameCache.clear();
m_rootComponentList.clear();
- m_initialCheckedState.clear();
- m_currentCheckedState.clear();
m_modelState = DefaultChecked;
+ // 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
+ // states is absent initially.
+ m_initialCheckedState[Qt::Checked] = ComponentSet();
+ m_initialCheckedState[Qt::Unchecked] = ComponentSet();
+ m_initialCheckedState[Qt::PartiallyChecked] = ComponentSet();
+ m_currentCheckedState = m_initialCheckedState; // both should be equal
+
// show virtual components only in case we run as updater or if the core engine is set to show them
const bool showVirtuals = m_core->isUpdater() || m_core->virtualComponentsVisible();
foreach (Component *const component, rootComponents) {