summaryrefslogtreecommitdiffstats
path: root/common/resourceaccess.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-01-25 11:23:08 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-01-25 11:23:08 +0100
commit3fc8ce958fc244e64a3a3a92f3b1440aae04133b (patch)
tree4ba2b3ca3ee6a17e7f3e7ce67d6ca934626cad7a /common/resourceaccess.cpp
parent9b744da32e64d8a6cd342faba8fc3232884d60f2 (diff)
downloadsink-3fc8ce958fc244e64a3a3a92f3b1440aae04133b.tar.gz
sink-3fc8ce958fc244e64a3a3a92f3b1440aae04133b.zip
A way to ensure all messages have been processed.
As queries become reactive this should become less important. We can then just wait until all results become available. For tests it is in either case useful though.
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r--common/resourceaccess.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index 73a01ca..5d067c5 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -25,6 +25,7 @@
25#include "common/commandcompletion_generated.h" 25#include "common/commandcompletion_generated.h"
26#include "common/handshake_generated.h" 26#include "common/handshake_generated.h"
27#include "common/revisionupdate_generated.h" 27#include "common/revisionupdate_generated.h"
28#include "common/synchronize_generated.h"
28 29
29#include <QCoreApplication> 30#include <QCoreApplication>
30#include <QDebug> 31#include <QDebug>
@@ -186,9 +187,12 @@ Async::Job<void> ResourceAccess::sendCommand(int commandId, flatbuffers::FlatBu
186 }); 187 });
187} 188}
188 189
189Async::Job<void> ResourceAccess::synchronizeResource() 190Async::Job<void> ResourceAccess::synchronizeResource(bool sourceSync, bool localSync)
190{ 191{
191 return sendCommand(Commands::SynchronizeCommand); 192 auto command = Akonadi2::CreateSynchronize(d->fbb, sourceSync, localSync);
193 Akonadi2::FinishSynchronizeBuffer(d->fbb, command);
194 return sendCommand(Commands::SynchronizeCommand, d->fbb);
195 d->fbb.Clear();
192} 196}
193 197
194void ResourceAccess::open() 198void ResourceAccess::open()