diff options
Diffstat (limited to 'common/modelresult.h')
-rw-r--r-- | common/modelresult.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/common/modelresult.h b/common/modelresult.h index f30a8e1..cc263cf 100644 --- a/common/modelresult.h +++ b/common/modelresult.h | |||
@@ -30,15 +30,23 @@ | |||
30 | #include "resultprovider.h" | 30 | #include "resultprovider.h" |
31 | #include "threadboundary.h" | 31 | #include "threadboundary.h" |
32 | 32 | ||
33 | namespace Sink { | ||
34 | class Notifier; | ||
35 | } | ||
36 | |||
33 | template <class T, class Ptr> | 37 | template <class T, class Ptr> |
34 | class ModelResult : public QAbstractItemModel | 38 | class ModelResult : public QAbstractItemModel |
35 | { | 39 | { |
36 | public: | 40 | public: |
41 | //Update the copy in store.h as well if you modify this | ||
37 | enum Roles | 42 | enum Roles |
38 | { | 43 | { |
39 | DomainObjectRole = Qt::UserRole + 1, | 44 | DomainObjectRole = Qt::UserRole + 1, |
40 | ChildrenFetchedRole, | 45 | ChildrenFetchedRole, |
41 | DomainObjectBaseRole | 46 | DomainObjectBaseRole, |
47 | StatusRole, //ApplicationDomain::SyncStatus | ||
48 | WarningRole, //ApplicationDomain::Warning, only if status == warning || status == error | ||
49 | ProgressRole //ApplicationDomain::Progress | ||
42 | }; | 50 | }; |
43 | 51 | ||
44 | ModelResult(const Sink::Query &query, const QList<QByteArray> &propertyColumns, const Sink::Log::Context &); | 52 | ModelResult(const Sink::Query &query, const QList<QByteArray> &propertyColumns, const Sink::Log::Context &); |
@@ -77,9 +85,11 @@ private: | |||
77 | QSet<qint64 /* entity id */> mEntityChildrenFetched; | 85 | QSet<qint64 /* entity id */> mEntityChildrenFetched; |
78 | QSet<qint64 /* entity id */> mEntityChildrenFetchComplete; | 86 | QSet<qint64 /* entity id */> mEntityChildrenFetchComplete; |
79 | QSet<qint64 /* entity id */> mEntityAllChildrenFetched; | 87 | QSet<qint64 /* entity id */> mEntityAllChildrenFetched; |
88 | QMap<qint64 /* entity id */, int /* Status */> mEntityStatus; | ||
80 | QList<QByteArray> mPropertyColumns; | 89 | QList<QByteArray> mPropertyColumns; |
81 | Sink::Query mQuery; | 90 | Sink::Query mQuery; |
82 | std::function<void(const Ptr &)> loadEntities; | 91 | std::function<void(const Ptr &)> loadEntities; |
83 | typename Sink::ResultEmitter<Ptr>::Ptr mEmitter; | 92 | typename Sink::ResultEmitter<Ptr>::Ptr mEmitter; |
84 | async::ThreadBoundary threadBoundary; | 93 | async::ThreadBoundary threadBoundary; |
94 | QScopedPointer<Sink::Notifier> mNotifier; | ||
85 | }; | 95 | }; |