summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/componentmodel.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-02-18 17:19:40 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-02-19 14:19:09 +0100
commit5cd196bfc78098d02100e48811b5d5d696058d96 (patch)
tree54548bd5aa1777f3ef04462b54f1334ee7d71fa7 /src/libs/installer/componentmodel.cpp
parent9d4c8d4121cb63300c11aabe6a32ea357e83bbef (diff)
Fix minor issues, we did calculate the parent index wrong.
Change-Id: I1ff08429e145846d75485625ab76ec6b5b39240b Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/componentmodel.cpp')
-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();
}