diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-07 21:48:44 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-07 21:48:44 +0100 |
commit | 89b6f63bab839ab0504cd3067f0389afe4dc47e3 (patch) | |
tree | 62c527983d63827bb722010ea8c59d5af0e5a879 /common/resourceaccess.cpp | |
parent | 438c74630e5f8c9a46d00b991f5cb8ecd479dafe (diff) | |
download | sink-89b6f63bab839ab0504cd3067f0389afe4dc47e3.tar.gz sink-89b6f63bab839ab0504cd3067f0389afe4dc47e3.zip |
Implement debug stream operators for query.
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r-- | common/resourceaccess.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index e509292..1847949 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -301,6 +301,25 @@ KAsync::Job<void> ResourceAccess::synchronizeResource(bool sourceSync, bool loca | |||
301 | return sendCommand(Commands::SynchronizeCommand, fbb); | 301 | return sendCommand(Commands::SynchronizeCommand, fbb); |
302 | } | 302 | } |
303 | 303 | ||
304 | KAsync::Job<void> ResourceAccess::synchronizeResource(const Sink::QueryBase &query) | ||
305 | { | ||
306 | flatbuffers::FlatBufferBuilder fbb; | ||
307 | QByteArray queryString; | ||
308 | { | ||
309 | QDataStream stream(&queryString, QIODevice::WriteOnly); | ||
310 | stream << query; | ||
311 | } | ||
312 | auto q = fbb.CreateString(queryString.toStdString()); | ||
313 | auto builder = Sink::Commands::SynchronizeBuilder(fbb); | ||
314 | builder.add_sourceSync(true); | ||
315 | builder.add_localSync(false); | ||
316 | builder.add_query(q); | ||
317 | Sink::Commands::FinishSynchronizeBuffer(fbb, builder.Finish()); | ||
318 | |||
319 | open(); | ||
320 | return sendCommand(Commands::SynchronizeCommand, fbb); | ||
321 | } | ||
322 | |||
304 | KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) | 323 | KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) |
305 | { | 324 | { |
306 | flatbuffers::FlatBufferBuilder fbb; | 325 | flatbuffers::FlatBufferBuilder fbb; |