summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-19 14:07:17 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-19 14:07:17 +0100
commit1812c077d6461b3e9fb865f47cffafc3c179e136 (patch)
tree3f10a86e1867576d8987d25f489c27b49875aa35
parentd5b28efe4d7fc2a984243417d923ff5727234e94 (diff)
downloadsink-1812c077d6461b3e9fb865f47cffafc3c179e136.tar.gz
sink-1812c077d6461b3e9fb865f47cffafc3c179e136.zip
Disambiguate between what we want to flush
Even though the implementation is still exactly the same
-rw-r--r--common/clientapi.cpp5
-rw-r--r--common/clientapi.h5
-rw-r--r--tests/maildirresourcetest.cpp4
3 files changed, 12 insertions, 2 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp
index 40257bb..0b417d3 100644
--- a/common/clientapi.cpp
+++ b/common/clientapi.cpp
@@ -229,6 +229,11 @@ KAsync::Job<void> Store::flushMessageQueue(const QByteArrayList &resourceIdentif
229 .template then<void>([](){}); 229 .template then<void>([](){});
230} 230}
231 231
232KAsync::Job<void> Store::flushReplayQueue(const QByteArrayList &resourceIdentifier)
233{
234 return flushMessageQueue(resourceIdentifier);
235}
236
232template <class DomainType> 237template <class DomainType>
233KAsync::Job<DomainType> Store::fetchOne(const Akonadi2::Query &query) 238KAsync::Job<DomainType> Store::fetchOne(const Akonadi2::Query &query)
234{ 239{
diff --git a/common/clientapi.h b/common/clientapi.h
index 14caa7a..e1d5b8d 100644
--- a/common/clientapi.h
+++ b/common/clientapi.h
@@ -100,6 +100,11 @@ public:
100 static KAsync::Job<void> flushMessageQueue(const QByteArrayList &resourceIdentifier); 100 static KAsync::Job<void> flushMessageQueue(const QByteArrayList &resourceIdentifier);
101 101
102 /** 102 /**
103 * Flushes any pending messages that haven't been replayed to the source.
104 */
105 static KAsync::Job<void> flushReplayQueue(const QByteArrayList &resourceIdentifier);
106
107 /**
103 * Removes a resource from disk. 108 * Removes a resource from disk.
104 */ 109 */
105 static void removeFromDisk(const QByteArray &resourceIdentifier); 110 static void removeFromDisk(const QByteArray &resourceIdentifier);
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp
index 146489d..ec4f6a4 100644
--- a/tests/maildirresourcetest.cpp
+++ b/tests/maildirresourcetest.cpp
@@ -321,7 +321,7 @@ private Q_SLOTS:
321 auto mail = mails.first(); 321 auto mail = mails.first();
322 322
323 return Store::remove(*mail) 323 return Store::remove(*mail)
324 .then(Store::flushMessageQueue(query.resources)) //The change needs to be replayed already 324 .then(Store::flushReplayQueue(query.resources)) //The change needs to be replayed already
325 .then(Resources::inspect<Mail>(Resources::Inspection::ExistenceInspection(*mail, false))); 325 .then(Resources::inspect<Mail>(Resources::Inspection::ExistenceInspection(*mail, false)));
326 }) 326 })
327 .then<void>([](){}); 327 .then<void>([](){});
@@ -357,7 +357,7 @@ private Q_SLOTS:
357 mail->setProperty("unread", true); 357 mail->setProperty("unread", true);
358 auto inspectionCommand = Resources::Inspection::PropertyInspection(*mail, "unread", true); 358 auto inspectionCommand = Resources::Inspection::PropertyInspection(*mail, "unread", true);
359 return Store::modify(*mail) 359 return Store::modify(*mail)
360 .then<void>(Store::flushMessageQueue(query.resources)) //The change needs to be replayed already 360 .then<void>(Store::flushReplayQueue(query.resources)) //The change needs to be replayed already
361 .then(Resources::inspect<Mail>(inspectionCommand)); 361 .then(Resources::inspect<Mail>(inspectionCommand));
362 }) 362 })
363 .then<void>([](){}); 363 .then<void>([](){});