summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/componentmodel.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index eaf3f3bab..a87f59c00 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -103,7 +103,7 @@ int ComponentModel::columnCount(const QModelIndex &parent) const
}
/*!
- Returns the parent of the child item with the given \a parent. If the item has no parent, an invalid
+ Returns the parent of the child item with the given \a child. If the item has no parent, an invalid
QModelIndex is returned.
*/
QModelIndex ComponentModel::parent(const QModelIndex &child) const
@@ -112,13 +112,9 @@ QModelIndex ComponentModel::parent(const QModelIndex &child) const
return QModelIndex();
if (Component *childComponent = componentFromIndex(child)) {
- if (Component *parent = childComponent->parentComponent()) {
- if (!m_rootComponentList.contains(parent))
- return createIndex(parent->indexInParent(), 0, parent);
- return createIndex(child.row(), 0, parent);
- }
+ if (Component *parent = childComponent->parentComponent())
+ return indexFromComponentName(parent->name());
}
-
return QModelIndex();
}