diff options
author | kh1 <qt-info@nokia.com> | 2011-03-23 20:20:33 +0100 |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2011-03-23 20:20:33 +0100 |
commit | e51dcab16d9d1360c92f41c0ee083feded5fa7af (patch) | |
tree | 9c03cbf029cf5a4f6b049e63a6120fa8aacc9668 /installerbuilder/libinstaller | |
parent | 2cc43240e6e77d7cc38547ef3e51c17a9bdbaf6c (diff) |
Some more getter for model handling.
Diffstat (limited to 'installerbuilder/libinstaller')
-rw-r--r-- | installerbuilder/libinstaller/qinstallercomponent.cpp | 19 | ||||
-rw-r--r-- | installerbuilder/libinstaller/qinstallercomponent.h | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/qinstallercomponent.cpp b/installerbuilder/libinstaller/qinstallercomponent.cpp index 3a3e4d34b..47f6945a8 100644 --- a/installerbuilder/libinstaller/qinstallercomponent.cpp +++ b/installerbuilder/libinstaller/qinstallercomponent.cpp @@ -1165,6 +1165,25 @@ bool Component::wasUninstalled() const return QLatin1String("Installed") == value(QLatin1String("PreviousState")) && !isInstalled(); } +int Component::childIndex() const +{ + if (d->m_parent) + return d->m_parent->d->m_components.indexOf(const_cast<Component*>(this)); + return 0; +} + +int Component::childCount() const +{ + return d->m_components.count(); +} + +Component* Component::childAt(int index) const +{ + if (index >= 0 && index < d->m_components.count()) + return d->m_components.value(index, 0); + return 0; +} + /*! Determines if the components installations status can be changed. */ diff --git a/installerbuilder/libinstaller/qinstallercomponent.h b/installerbuilder/libinstaller/qinstallercomponent.h index 9d344071c..cb4d965ec 100644 --- a/installerbuilder/libinstaller/qinstallercomponent.h +++ b/installerbuilder/libinstaller/qinstallercomponent.h @@ -189,6 +189,10 @@ public: Q_INVOKABLE bool isFromOnlineRepository() const; // model like handling + int childIndex() const; + int childCount() const; + Component* childAt(int index) const; + bool isEnabled() const; void setEnabled(bool enabled); |