diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-07 16:26:52 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-10 10:40:01 +0200 |
commit | 615fc9df81555ce5a2b16747640beba43e109ef4 (patch) | |
tree | e22c130d87adcb43f8769c4d4ca254f60b7b6ba1 /tests/genericfacadetest.cpp | |
parent | f689ad1021a7805f6f8b6a81f534b4cb9ca91f51 (diff) | |
download | sink-615fc9df81555ce5a2b16747640beba43e109ef4.tar.gz sink-615fc9df81555ce5a2b16747640beba43e109ef4.zip |
Always get the latest revision directly from storage
We can just as well read the latest available revision from storage.
Diffstat (limited to 'tests/genericfacadetest.cpp')
-rw-r--r-- | tests/genericfacadetest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index 4c58b91..f21de70 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp | |||
@@ -25,14 +25,16 @@ class TestEntityStorage : public EntityStorage<Akonadi2::ApplicationDomain::Even | |||
25 | { | 25 | { |
26 | public: | 26 | public: |
27 | using EntityStorage::EntityStorage; | 27 | using EntityStorage::EntityStorage; |
28 | virtual void read(const Akonadi2::Query &query, const QPair<qint64, qint64> &revisionRange, const QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> > &resultProvider) Q_DECL_OVERRIDE | 28 | virtual qint64 read(const Akonadi2::Query &query, qint64 oldRevision, const QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> > &resultProvider) Q_DECL_OVERRIDE |
29 | { | 29 | { |
30 | for (const auto &res : mResults) { | 30 | for (const auto &res : mResults) { |
31 | resultProvider->add(res); | 31 | resultProvider->add(res); |
32 | } | 32 | } |
33 | return mLatestRevision; | ||
33 | } | 34 | } |
34 | 35 | ||
35 | QList<Akonadi2::ApplicationDomain::Event::Ptr> mResults; | 36 | QList<Akonadi2::ApplicationDomain::Event::Ptr> mResults; |
37 | qint64 mLatestRevision; | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | class TestResourceAccess : public Akonadi2::ResourceAccessInterface | 40 | class TestResourceAccess : public Akonadi2::ResourceAccessInterface |
@@ -117,6 +119,7 @@ private Q_SLOTS: | |||
117 | //Enter a second result | 119 | //Enter a second result |
118 | storage->mResults.clear(); | 120 | storage->mResults.clear(); |
119 | storage->mResults << QSharedPointer<Akonadi2::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor>()); | 121 | storage->mResults << QSharedPointer<Akonadi2::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor>()); |
122 | storage->mLatestRevision = 2; | ||
120 | resourceAccess->emit revisionChanged(2); | 123 | resourceAccess->emit revisionChanged(2); |
121 | 124 | ||
122 | //Hack to get event loop in synclistresult to abort again | 125 | //Hack to get event loop in synclistresult to abort again |