summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-09-22 15:44:29 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-09-22 16:01:37 +0200
commit134c88b819d1c4866190a14336c6b56ef0f3acbe (patch)
tree15323b91278ed2c33a9bef49448ec017a6cbdc9c /src
parentf27c3da12c3c32d35656894a7e53108855ba55b3 (diff)
Add small auto test.
Also fix the implementation for append component in updater case as well as adjust the documentation. The returned list contains all components independent of the run mode. Change-Id: I36523e13c33b9ca6de6e02fcc31e0f0d6606f65b Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs/installer/component.cpp3
-rw-r--r--src/libs/installer/packagemanagercore.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index be0d01697..bdb3dfd60 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -406,6 +406,9 @@ Component *Component::parentComponent() const
*/
void Component::appendComponent(Component *component)
{
+ if (d->m_core->isUpdater())
+ throw Error(tr("Components cannot have children in updater mode."));
+
if (!component->isVirtual()) {
d->m_childComponents.append(component);
std::sort(d->m_childComponents.begin(), d->m_childComponents.end(), SortingPriorityGreaterThan());
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 6abfdb81c..d6a31286c 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1225,9 +1225,9 @@ void PackageManagerCore::appendUpdaterComponent(Component *component)
}
/*!
- Returns a list of all available components found during a fetch. Note that depending on the run mode the
- returned list might have different values. In case of updater mode, components scheduled for an
- update as well as all possible dependencies are returned.
+ Returns a list of all available components found during a fetch. Depending on the run mode the
+ returned list might have different values. \note: This function will return all components and
+ possible replacement components as well.
*/
QList<Component*> PackageManagerCore::availableComponents() const
{