diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-04-11 16:27:17 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-05-16 10:29:39 +0200 |
commit | ffa1ceb12086bf20d70acf27501cd91e3e2c544a (patch) | |
tree | 17fc97f6a7cc9d5e29fc602cf5a3ddc193459324 /src/libs/installer/componentmodel.cpp | |
parent | be321571a79467292828e37c5b77c1cc5b5bc8dc (diff) |
Fix component still visible after it's set "Virtual".
Task-number: QTIFW-466
Change-Id: I6a5e4d0d20703e2d4e867bb2619c82dac0b8a64c
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-rw-r--r-- | src/libs/installer/componentmodel.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp index 080e84d85..14be1e259 100644 --- a/src/libs/installer/componentmodel.cpp +++ b/src/libs/installer/componentmodel.cpp @@ -338,6 +338,7 @@ void ComponentModel::setRootComponents(QList<QInstaller::Component*> rootCompone // 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) { + connect(component, SIGNAL(virtualStateChanged()), this, SLOT(onVirtualStateChanged())); if ((!showVirtuals) && component->isVirtual()) continue; m_rootComponentList.append(component); @@ -396,6 +397,7 @@ void ComponentModel::slotModelReset() foreach (Component *const component, components) { if (component->checkState() == Qt::Checked) checked.insert(component); + connect(component, SIGNAL(virtualStateChanged()), this, SLOT(onVirtualStateChanged())); } updateCheckedState(checked, Qt::Checked); @@ -409,6 +411,16 @@ void ComponentModel::slotModelReset() updateAndEmitModelState(); // update the internal state } +void ComponentModel::onVirtualStateChanged() +{ + // If the virtual state of a component changes, force a reset of the component model. + // Make sure to pass the right components list depending on the package manager run mode. + if (m_core->isUpdater()) + setRootComponents(m_core->updaterComponents()); + else + setRootComponents(m_core->rootComponents()); +} + // -- private |