diff options
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 0bdb36bff..064e74cb5 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -45,7 +45,6 @@ #include "fsengineclient.h" #include "lib7z_facade.h" #include "packagemanagercore.h" -#include "qinstallerglobal.h" #include "messageboxhandler.h" #include <kdupdaterupdatesourcesinfo.h> @@ -306,23 +305,22 @@ void Component::removeComponent(Component *component) } /*! - Returns a list of child components. If \a recursive is set to true, the returned list - contains not only the direct children, but all ancestors. Note: The returned list does include ALL - children, non virtual components as well as virtual components. + Returns a list of child components. If \a kind is set to DirectChildrenOnly, the returned list contains + only the direct children, if set to Descendants it will also include all descendants of the components + children. Note: The returned list does include ALL children, non virtual components as well as virtual + components. */ -QList<Component*> Component::childComponents(bool recursive, RunMode runMode) const +QList<Component *> Component::childComponents(Kind kind) const { - QList<Component*> result; - if (runMode == UpdaterMode) - return result; + if (d->m_core->isUpdater()) + return QList<Component*>(); - if (!recursive) - return d->m_allChildComponents; + QList<Component *> result = d->m_allChildComponents; + if (kind == DirectChildrenOnly) + return result; - foreach (Component *component, d->m_allChildComponents) { - result.append(component); - result += component->childComponents(true, runMode); - } + foreach (Component *component, d->m_allChildComponents) + result += component->childComponents(kind); return result; } |