Changeset View
Changeset View
Standalone View
Standalone View
src/akonadi/akonadistorage.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | #include "akonadi/akonadiitemfetchjobinterface.h" | 51 | #include "akonadi/akonadiitemfetchjobinterface.h" | ||
52 | #include "akonadi/akonaditagfetchjobinterface.h" | 52 | #include "akonadi/akonaditagfetchjobinterface.h" | ||
53 | #include "akonadi/akonadistoragesettings.h" | 53 | #include "akonadi/akonadistoragesettings.h" | ||
54 | 54 | | |||
55 | using namespace Akonadi; | 55 | using namespace Akonadi; | ||
56 | 56 | | |||
57 | class CollectionJob : public CollectionFetchJob, public CollectionFetchJobInterface | 57 | class CollectionJob : public CollectionFetchJob, public CollectionFetchJobInterface | ||
58 | { | 58 | { | ||
59 | Q_OBJECT | ||||
59 | public: | 60 | public: | ||
60 | CollectionJob(const Collection &collection, Type type = FirstLevel, QObject *parent = Q_NULLPTR) | 61 | CollectionJob(const Collection &collection, Type type = FirstLevel, QObject *parent = Q_NULLPTR) | ||
61 | : CollectionFetchJob(collection, type, parent), | 62 | : CollectionFetchJob(collection, type, parent), | ||
62 | m_collection(collection), | 63 | m_collection(collection), | ||
63 | m_type(type) | 64 | m_type(type) | ||
64 | { | 65 | { | ||
65 | } | 66 | } | ||
66 | 67 | | |||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
126 | 127 | | |||
127 | private: | 128 | private: | ||
128 | const Collection m_collection; | 129 | const Collection m_collection; | ||
129 | const Type m_type; | 130 | const Type m_type; | ||
130 | }; | 131 | }; | ||
131 | 132 | | |||
132 | class CollectionSearchJob : public CollectionFetchJob, public CollectionSearchJobInterface | 133 | class CollectionSearchJob : public CollectionFetchJob, public CollectionSearchJobInterface | ||
133 | { | 134 | { | ||
135 | Q_OBJECT | ||||
134 | public: | 136 | public: | ||
135 | CollectionSearchJob(const QString &collectionName, QObject *parent = Q_NULLPTR) | 137 | CollectionSearchJob(const QString &collectionName, QObject *parent = Q_NULLPTR) | ||
136 | : CollectionFetchJob(Akonadi::Collection::root(), | 138 | : CollectionFetchJob(Akonadi::Collection::root(), | ||
137 | CollectionJob::Recursive, | 139 | CollectionJob::Recursive, | ||
138 | parent), | 140 | parent), | ||
139 | m_collectionName(collectionName) | 141 | m_collectionName(collectionName) | ||
140 | { | 142 | { | ||
141 | } | 143 | } | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
187 | } | 189 | } | ||
188 | 190 | | |||
189 | private: | 191 | private: | ||
190 | QString m_collectionName; | 192 | QString m_collectionName; | ||
191 | }; | 193 | }; | ||
192 | 194 | | |||
193 | class ItemJob : public ItemFetchJob, public ItemFetchJobInterface | 195 | class ItemJob : public ItemFetchJob, public ItemFetchJobInterface | ||
194 | { | 196 | { | ||
197 | Q_OBJECT | ||||
195 | public: | 198 | public: | ||
196 | using ItemFetchJob::ItemFetchJob; | 199 | using ItemFetchJob::ItemFetchJob; | ||
197 | 200 | | |||
198 | Item::List items() const Q_DECL_OVERRIDE { return ItemFetchJob::items(); } | 201 | Item::List items() const Q_DECL_OVERRIDE { return ItemFetchJob::items(); } | ||
199 | 202 | | |||
200 | void setCollection(const Collection &collection) Q_DECL_OVERRIDE | 203 | void setCollection(const Collection &collection) Q_DECL_OVERRIDE | ||
201 | { | 204 | { | ||
202 | ItemFetchJob::setCollection(collection); | 205 | ItemFetchJob::setCollection(collection); | ||
203 | } | 206 | } | ||
204 | }; | 207 | }; | ||
205 | 208 | | |||
206 | class TagJob : public TagFetchJob, public TagFetchJobInterface | 209 | class TagJob : public TagFetchJob, public TagFetchJobInterface | ||
207 | { | 210 | { | ||
211 | Q_OBJECT | ||||
208 | public: | 212 | public: | ||
209 | using TagFetchJob::TagFetchJob; | 213 | using TagFetchJob::TagFetchJob; | ||
210 | 214 | | |||
211 | Tag::List tags() const Q_DECL_OVERRIDE { return TagFetchJob::tags(); } | 215 | Tag::List tags() const Q_DECL_OVERRIDE { return TagFetchJob::tags(); } | ||
212 | }; | 216 | }; | ||
213 | 217 | | |||
214 | Storage::Storage() | 218 | Storage::Storage() | ||
215 | { | 219 | { | ||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | 397 | { | |||
394 | auto scope = job->fetchScope(); | 398 | auto scope = job->fetchScope(); | ||
395 | scope.fetchFullPayload(); | 399 | scope.fetchFullPayload(); | ||
396 | scope.fetchAllAttributes(); | 400 | scope.fetchAllAttributes(); | ||
397 | scope.setFetchTags(true); | 401 | scope.setFetchTags(true); | ||
398 | scope.tagFetchScope().setFetchIdOnly(false); | 402 | scope.tagFetchScope().setFetchIdOnly(false); | ||
399 | scope.setAncestorRetrieval(ItemFetchScope::All); | 403 | scope.setAncestorRetrieval(ItemFetchScope::All); | ||
400 | job->setFetchScope(scope); | 404 | job->setFetchScope(scope); | ||
401 | } | 405 | } | ||
406 | | ||||
407 | #include "akonadistorage.moc" |