[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [akonadi-next/develop] common: ModelResult: return an invalid QModelIndex for the toplevel parent
From: Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date: 2015-11-30 17:52:54
Message-ID: E1a3SdC-0003TI-4L () scm ! kde ! org
[Download RAW message or body]
Git commit bf28c2e3f43038165dc83c10267d103e779b245e by Christian Mollekopf.
Committed on 30/11/2015 at 12:45.
Pushed by cmollekopf into branch 'develop'.
ModelResult: return an invalid QModelIndex for the toplevel parent
M +3 -0 common/modelresult.cpp
http://commits.kde.org/akonadi-next/bf28c2e3f43038165dc83c10267d103e779b245e
diff --git a/common/modelresult.cpp b/common/modelresult.cpp
index 4def20f..e2a05f8 100644
--- a/common/modelresult.cpp
+++ b/common/modelresult.cpp
@@ -100,6 +100,9 @@ QModelIndex ModelResult<T, Ptr>::index(int row, int column, const QModelIndex &p
template<class T, class Ptr>
QModelIndex ModelResult<T, Ptr>::createIndexFromId(const qint64 &id) const
{
+ if (id == 0) {
+ return QModelIndex();
+ }
auto grandParentId = mParents.value(id, 0);
auto row = mTree.value(grandParentId).indexOf(id);
return createIndex(row, 0, id);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic