diff options
Diffstat (limited to 'examples/dummyresource/facade.cpp')
-rw-r--r-- | examples/dummyresource/facade.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/dummyresource/facade.cpp b/examples/dummyresource/facade.cpp index 37f75ae..c1e7a64 100644 --- a/examples/dummyresource/facade.cpp +++ b/examples/dummyresource/facade.cpp | |||
@@ -127,7 +127,7 @@ void DummyResourceFacade::readValue(QSharedPointer<Akonadi2::Storage> storage, c | |||
127 | }); | 127 | }); |
128 | } | 128 | } |
129 | 129 | ||
130 | Async::Job<qint64> DummyResourceFacade::load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::ApplicationDomain::Event::Ptr &)> &resultCallback) | 130 | Async::Job<qint64> DummyResourceFacade::load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> > &resultProvider, qint64 oldRevision, qint64 newRevision) |
131 | { | 131 | { |
132 | return Async::start<qint64>([=](Async::Future<qint64> &future) { | 132 | return Async::start<qint64>([=](Async::Future<qint64> &future) { |
133 | //Now that the sync is complete we can execute the query | 133 | //Now that the sync is complete we can execute the query |
@@ -153,6 +153,11 @@ Async::Job<qint64> DummyResourceFacade::load(const Akonadi2::Query &query, const | |||
153 | }); | 153 | }); |
154 | } | 154 | } |
155 | 155 | ||
156 | // TODO only emit changes and don't replace everything | ||
157 | resultProvider->clear(); | ||
158 | // rerun query | ||
159 | auto resultCallback = std::bind(&Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr>::add, resultProvider, std::placeholders::_1); | ||
160 | |||
156 | if (keys.isEmpty()) { | 161 | if (keys.isEmpty()) { |
157 | Log() << "Executing a full scan"; | 162 | Log() << "Executing a full scan"; |
158 | readValue(storage, QByteArray(), resultCallback, preparedQuery); | 163 | readValue(storage, QByteArray(), resultCallback, preparedQuery); |