diff options
-rw-r--r-- | common/clientapi.h | 3 | ||||
-rw-r--r-- | common/modelresult.cpp | 4 | ||||
-rw-r--r-- | common/modelresult.h | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/common/clientapi.h b/common/clientapi.h index edf42e4..074aabc 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -45,7 +45,8 @@ public: | |||
45 | 45 | ||
46 | enum Roles { | 46 | enum Roles { |
47 | DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult | 47 | DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult |
48 | ChildrenFetchedRole | 48 | ChildrenFetchedRole, |
49 | DomainObjectBaseRole | ||
49 | }; | 50 | }; |
50 | 51 | ||
51 | /** | 52 | /** |
diff --git a/common/modelresult.cpp b/common/modelresult.cpp index c7fcd49..4fd8d97 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp | |||
@@ -71,6 +71,10 @@ QVariant ModelResult<T, Ptr>::data(const QModelIndex &index, int role) const | |||
71 | Q_ASSERT(mEntities.contains(index.internalId())); | 71 | Q_ASSERT(mEntities.contains(index.internalId())); |
72 | return QVariant::fromValue(mEntities.value(index.internalId())); | 72 | return QVariant::fromValue(mEntities.value(index.internalId())); |
73 | } | 73 | } |
74 | if (role == DomainObjectBaseRole) { | ||
75 | Q_ASSERT(mEntities.contains(index.internalId())); | ||
76 | return QVariant::fromValue(mEntities.value(index.internalId()). template staticCast<Akonadi2::ApplicationDomain::ApplicationDomainType>()); | ||
77 | } | ||
74 | if (role == ChildrenFetchedRole) { | 78 | if (role == ChildrenFetchedRole) { |
75 | return childrenFetched(index); | 79 | return childrenFetched(index); |
76 | } | 80 | } |
diff --git a/common/modelresult.h b/common/modelresult.h index 700064b..298e157 100644 --- a/common/modelresult.h +++ b/common/modelresult.h | |||
@@ -34,7 +34,8 @@ class ModelResult : public QAbstractItemModel | |||
34 | public: | 34 | public: |
35 | enum Roles { | 35 | enum Roles { |
36 | DomainObjectRole = Qt::UserRole + 1, | 36 | DomainObjectRole = Qt::UserRole + 1, |
37 | ChildrenFetchedRole | 37 | ChildrenFetchedRole, |
38 | DomainObjectBaseRole | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | ModelResult(const Akonadi2::Query &query, const QList<QByteArray> &propertyColumns); | 41 | ModelResult(const Akonadi2::Query &query, const QList<QByteArray> &propertyColumns); |