summaryrefslogtreecommitdiffstats
path: root/pokemodr/PokemodTreeModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/PokemodTreeModel.cpp')
-rw-r--r--pokemodr/PokemodTreeModel.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/pokemodr/PokemodTreeModel.cpp b/pokemodr/PokemodTreeModel.cpp
index 03532c40..e41ec0d8 100644
--- a/pokemodr/PokemodTreeModel.cpp
+++ b/pokemodr/PokemodTreeModel.cpp
@@ -53,12 +53,9 @@ QVariant PokemodTreeModel::headerData(int /*section*/, Qt::Orientation /*orienta
QModelIndex PokemodTreeModel::index(int row, int /*column*/, const QModelIndex& parent) const
{
if (row < 0)
- return createIndex(-1, 0, m_root);
+ return createIndex(row, 0, m_root);
BaseModel* object = getItem(parent)->childItem(row);
- if (object)
- return createIndex(row, 0, object);
- else
- return QModelIndex();
+ return createIndex(row, 0, object);
}
QModelIndex PokemodTreeModel::parent(const QModelIndex& index) const