diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2014-12-29 19:56:23 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-06 16:45:27 +0100 |
commit | 3e786efb2811f1e88485ffff50d1327d07f40892 (patch) | |
tree | bdcc7826c4799e168454d296e8d769897b6b7a1f /common/resourceaccess.cpp | |
parent | e1c6979863b4994eabeb7ae35208472c234b24f6 (diff) | |
download | sink-3e786efb2811f1e88485ffff50d1327d07f40892.tar.gz sink-3e786efb2811f1e88485ffff50d1327d07f40892.zip |
Turned synchronizeResource command into a job.
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r-- | common/resourceaccess.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 31b9e79..9fb0d4c 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -161,9 +161,13 @@ void ResourceAccess::sendCommand(int commandId, flatbuffers::FlatBufferBuilder & | |||
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | void ResourceAccess::synchronizeResource(const std::function<void()> &resultHandler) | 164 | Async::Job<void> ResourceAccess::synchronizeResource() |
165 | { | 165 | { |
166 | sendCommand(Commands::SynchronizeCommand, resultHandler); | 166 | return Async::start<void>([this](Async::Future<void> &f) { |
167 | sendCommand(Commands::SynchronizeCommand, [&f]() { | ||
168 | f.setFinished(); | ||
169 | }); | ||
170 | }); | ||
167 | } | 171 | } |
168 | 172 | ||
169 | void ResourceAccess::open() | 173 | void ResourceAccess::open() |