diff options
author | kh1 <karsten.heimrich@nokia.com> | 2012-04-23 17:27:46 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2012-04-25 14:23:56 +0200 |
commit | 3eb3be2e042a6c93007f8bf4a1b6079b4961d919 (patch) | |
tree | 98d9b55d91bdfe65718e5dc9506e9a75e9a0df72 /src/libs/installer/componentmodel.cpp | |
parent | c6821e8dc0b1c4724f158d4714b7b25e60bd6638 (diff) |
Move the models inside core engine.
Improves the situation for qml based installer.
Change-Id: Ia7198f0720a1268c7918517228c13255cccce4ea
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-rw-r--r-- | src/libs/installer/componentmodel.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp index ec61ee84e..42e381c0d 100644 --- a/src/libs/installer/componentmodel.cpp +++ b/src/libs/installer/componentmodel.cpp @@ -229,44 +229,6 @@ Qt::ItemFlags ComponentModel::flags(const QModelIndex &index) const } /*! - Set's the passed \a rootComponents to be list of currently shown components. The model is repopulated and - the individual component checked state is used to show the check mark in front of the visual component - representation. The modelAboutToBeReset() and modelReset() signals are emitted. -*/ -void ComponentModel::setRootComponents(QList<Component*> rootComponents) -{ - beginResetModel(); - - m_indexByNameCache.clear(); - m_rootComponentList.clear(); - m_initialCheckedSet.clear(); - m_currentCheckedSet.clear(); - - m_rootIndex = 0; - m_rootComponentList = rootComponents; - - endResetModel(); -} - -/*! - Appends the passed \a rootComponents to the currently shown list of components. The model is repopulated - and the individual component checked state is used to show the check mark in front of the visual component - representation. Already changed check states on the previous model are preserved. The modelAboutToBeReset() - and modelReset() signals are emitted. -*/ -void ComponentModel::appendRootComponents(QList<Component*> rootComponents) -{ - beginResetModel(); - - m_indexByNameCache.clear(); - - m_rootIndex = m_rootComponentList.count() - 1; - m_rootComponentList += rootComponents; - - endResetModel(); -} - -/*! Returns a pointer to the PackageManagerCore this model belongs to. */ PackageManagerCore *ComponentModel::packageManagerCore() const @@ -363,6 +325,44 @@ void ComponentModel::selectDefault() emit defaultCheckStateChanged(m_initialCheckedSet != m_currentCheckedSet); } +/*! + Set's the passed \a rootComponents to be list of currently shown components. The model is repopulated and + the individual component checked state is used to show the check mark in front of the visual component + representation. The modelAboutToBeReset() and modelReset() signals are emitted. +*/ +void ComponentModel::setRootComponents(QList<QInstaller::Component*> rootComponents) +{ + beginResetModel(); + + m_indexByNameCache.clear(); + m_rootComponentList.clear(); + m_initialCheckedSet.clear(); + m_currentCheckedSet.clear(); + + m_rootIndex = 0; + m_rootComponentList = rootComponents; + + endResetModel(); +} + +/*! + Appends the passed \a rootComponents to the currently shown list of components. The model is repopulated + and the individual component checked state is used to show the check mark in front of the visual component + representation. Already changed check states on the previous model are preserved. The modelAboutToBeReset() + and modelReset() signals are emitted. +*/ +void ComponentModel::appendRootComponents(QList<QInstaller::Component*> rootComponents) +{ + beginResetModel(); + + m_indexByNameCache.clear(); + + m_rootIndex = m_rootComponentList.count() - 1; + m_rootComponentList += rootComponents; + + endResetModel(); +} + // -- private slots void ComponentModel::slotModelReset() |