summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/componentmodel.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-08-06 15:30:56 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-08-07 12:09:20 +0200
commit0476fb13e05c6442c785501ea1eacfc4304d6cdd (patch)
tree75662fe8b0fcd0c4796f199566dfff4a3790d88e /src/libs/installer/componentmodel.cpp
parentcf4960e84c35054efc72c683b8062d78fcb6a842 (diff)
Fix component selection shows wrong package sizes.
Task-number: QTIFW-302 This patch extends patch d4642f3ff. Reduce the number of calls to calculate the uncompressed size to do it only once per model update. We need to update the current selected component to reflect possible sub-node changes. Change-Id: I4a8121148f1974872b3c43d2f58351aad9c59421 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-rw-r--r--src/libs/installer/componentmodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index d4536e249..5285154f6 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -399,10 +399,6 @@ void ComponentModel::slotModelReset()
m_initialCheckedState[component->checkState()].insert(component);
}
- // update all checked components uncompressed size (important for nodes)
- foreach (QInstaller::Component *component, checked)
- component->updateUncompressedSize();
-
m_currentCheckedState = m_initialCheckedState;
updateAndEmitModelState(); // update the internal state
}
@@ -524,6 +520,10 @@ QSet<QModelIndex> ComponentModel::updateCheckedState(const ComponentSet &compone
break;
}
}
+
+ // update all nodes uncompressed size
+ foreach (Component *const node, m_rootComponentList)
+ node->updateUncompressedSize(); // this is a recursive call
return changed;
}