diff options
author | jkobus <jaroslaw.kobus@digia.com> | 2014-08-28 15:56:58 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@digia.com> | 2014-08-29 12:38:10 +0200 |
commit | c855e20dff8feda133fa344ac9cb5542b986cf4f (patch) | |
tree | 08c18e3445416e8b8a253e02004cad767560e422 /src/libs/installer | |
parent | 531a57b34cd022a2763fea7b3203e581bb065cc4 (diff) |
Remove unneeded status check
Looks like none of the functions invoked in meantime
can potentially change the status.
Change-Id: I04da950138610c6ab7ad5dc0f0efce589a3815cf
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs/installer')
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 8e1039426..df552e68d 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -332,12 +332,11 @@ QString PackageManagerCorePrivate::componentsXmlPath() const bool PackageManagerCorePrivate::buildComponentTree(QHash<QString, Component*> &components, bool loadScript) { try { + if (statusCanceledOrFailed()) + return false; // append all components to their respective parents QHash<QString, Component*>::const_iterator it; for (it = components.begin(); it != components.end(); ++it) { - if (statusCanceledOrFailed()) - return false; - QString id = it.key(); QInstaller::Component *component = it.value(); while (!id.isEmpty() && component->parentComponent() == 0) { @@ -349,26 +348,18 @@ bool PackageManagerCorePrivate::buildComponentTree(QHash<QString, Component*> &c // append all components w/o parent to the direct list foreach (QInstaller::Component *component, components) { - if (statusCanceledOrFailed()) - return false; - if (component->parentComponent() == 0) m_core->appendRootComponent(component); } // after everything is set up, load the scripts if needed if (loadScript) { - foreach (QInstaller::Component *component, components) { - if (statusCanceledOrFailed()) - return false; - component->loadComponentScript(); - } + foreach (QInstaller::Component *component, components) + component->loadComponentScript(); } + // now we can preselect components in the tree foreach (QInstaller::Component *component, components) { - if (statusCanceledOrFailed()) - return false; - // set the checked state for all components without child (means without tristate) if (component->isCheckable() && !component->isTristate()) { if (component->isDefault() && isInstaller()) @@ -377,6 +368,7 @@ bool PackageManagerCorePrivate::buildComponentTree(QHash<QString, Component*> &c component->setCheckState(Qt::Checked); } } + std::sort(m_rootComponents.begin(), m_rootComponents.end(), Component::SortingPriorityGreaterThan()); } catch (const Error &error) { clearAllComponentLists(); |