diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-30 11:09:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-30 11:09:31 +0100 |
commit | b5648af02ea7246b41d24e242c5f94e43e43980e (patch) | |
tree | 141fa70a3336bde700b232e5d978b04c3eb8a887 /common/modelresult.h | |
parent | f715898a1b6781e2860727942ce510f324a23c71 (diff) | |
download | sink-b5648af02ea7246b41d24e242c5f94e43e43980e.tar.gz sink-b5648af02ea7246b41d24e242c5f94e43e43980e.zip |
Provide status information about children fetch state
The fetch state is per parent.
Diffstat (limited to 'common/modelresult.h')
-rw-r--r-- | common/modelresult.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/modelresult.h b/common/modelresult.h index 3ccf629..700064b 100644 --- a/common/modelresult.h +++ b/common/modelresult.h | |||
@@ -33,7 +33,8 @@ class ModelResult : public QAbstractItemModel | |||
33 | { | 33 | { |
34 | public: | 34 | public: |
35 | enum Roles { | 35 | enum Roles { |
36 | DomainObjectRole = Qt::UserRole + 1 | 36 | DomainObjectRole = Qt::UserRole + 1, |
37 | ChildrenFetchedRole | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | ModelResult(const Akonadi2::Query &query, const QList<QByteArray> &propertyColumns); | 40 | ModelResult(const Akonadi2::Query &query, const QList<QByteArray> &propertyColumns); |
@@ -56,6 +57,8 @@ public: | |||
56 | 57 | ||
57 | void setFetcher(const std::function<void(const Ptr &parent)> &fetcher); | 58 | void setFetcher(const std::function<void(const Ptr &parent)> &fetcher); |
58 | 59 | ||
60 | bool childrenFetched(const QModelIndex &) const; | ||
61 | |||
59 | private: | 62 | private: |
60 | qint64 parentId(const Ptr &value); | 63 | qint64 parentId(const Ptr &value); |
61 | QModelIndex createIndexFromId(const qint64 &id) const; | 64 | QModelIndex createIndexFromId(const qint64 &id) const; |
@@ -65,7 +68,8 @@ private: | |||
65 | QMap<qint64 /* entity id */, Ptr> mEntities; | 68 | QMap<qint64 /* entity id */, Ptr> mEntities; |
66 | QMap<qint64 /* parent entity id */, QList<qint64> /* child entity id*/> mTree; | 69 | QMap<qint64 /* parent entity id */, QList<qint64> /* child entity id*/> mTree; |
67 | QMap<qint64 /* child entity id */, qint64 /* parent entity id*/> mParents; | 70 | QMap<qint64 /* child entity id */, qint64 /* parent entity id*/> mParents; |
68 | QMap<qint64 /* entity id */, bool> mEntityChildrenFetched; | 71 | QSet<qint64 /* entity id */> mEntityChildrenFetched; |
72 | QSet<qint64 /* entity id */> mEntityChildrenFetchComplete; | ||
69 | QList<QByteArray> mPropertyColumns; | 73 | QList<QByteArray> mPropertyColumns; |
70 | Akonadi2::Query mQuery; | 74 | Akonadi2::Query mQuery; |
71 | std::function<void(const Ptr &)> loadEntities; | 75 | std::function<void(const Ptr &)> loadEntities; |