Merge lp:~michihenning/storage-framework/remove-qfuture-overloads into lp:storage-framework/devel
- remove-qfuture-overloads
- Merge into devel
Status: | Merged |
---|---|
Merged at revision: | 66 |
Proposed branch: | lp:~michihenning/storage-framework/remove-qfuture-overloads |
Merge into: | lp:storage-framework/devel |
Diff against target: |
705 lines (+131/-92) 13 files modified
include/unity/storage/qt/client/internal/make_future.h (+13/-28) include/unity/storage/qt/client/internal/remote_client/Handler.h (+8/-4) src/qt/client/internal/local_client/DownloaderImpl.cpp (+6/-5) src/qt/client/internal/local_client/UploaderImpl.cpp (+22/-11) src/qt/client/internal/remote_client/AccountImpl.cpp (+4/-2) src/qt/client/internal/remote_client/DownloaderImpl.cpp (+1/-1) src/qt/client/internal/remote_client/FileImpl.cpp (+13/-6) src/qt/client/internal/remote_client/FolderImpl.cpp (+24/-12) src/qt/client/internal/remote_client/ItemImpl.cpp (+17/-9) src/qt/client/internal/remote_client/RootImpl.cpp (+6/-3) src/qt/client/internal/remote_client/RuntimeImpl.cpp (+10/-5) src/qt/client/internal/remote_client/UploaderImpl.cpp (+7/-4) tests/local-client/local-client_test.cpp (+0/-2) |
To merge this branch: | bzr merge lp:~michihenning/storage-framework/remove-qfuture-overloads |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
unity-api-1-bot | continuous-integration | Needs Fixing | |
Michi Henning (community) | Approve | ||
James Henstridge | Approve | ||
Review via email:
|
Commit message
Removed overloads from make_future.h that accept a QFutureInterface because that made it too easy to accidentally call the wrong overload. Added attribute to remaining functions to warn if the return value is unused.
Description of the change
Removed overloads from make_future.h that accept a QFutureInterface because that made it too easy to accidentally call the wrong overload. Added attribute to remaining functions to warn if the return value is unused.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
Merged manually into devel because Jenkins is sick.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:69
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'include/unity/storage/qt/client/internal/make_future.h' | |||
2 | --- include/unity/storage/qt/client/internal/make_future.h 2016-08-02 03:02:15 +0000 | |||
3 | +++ include/unity/storage/qt/client/internal/make_future.h 2016-09-06 03:34:37 +0000 | |||
4 | @@ -37,7 +37,9 @@ | |||
5 | 37 | { | 37 | { |
6 | 38 | 38 | ||
7 | 39 | template<typename T> | 39 | template<typename T> |
9 | 40 | QFuture<T> make_ready_future(T const& val) | 40 | QFuture<T> |
10 | 41 | __attribute__ ((warn_unused_result)) | ||
11 | 42 | make_ready_future(T const& val) | ||
12 | 41 | { | 43 | { |
13 | 42 | QFutureInterface<T> qf; | 44 | QFutureInterface<T> qf; |
14 | 43 | qf.reportResult(val); | 45 | qf.reportResult(val); |
15 | @@ -45,30 +47,19 @@ | |||
16 | 45 | return qf.future(); | 47 | return qf.future(); |
17 | 46 | } | 48 | } |
18 | 47 | 49 | ||
36 | 48 | template<typename T> | 50 | template<typename T = void> |
37 | 49 | QFuture<T> make_ready_future(QFutureInterface<T> qf, T const& val) | 51 | QFuture<T> |
38 | 50 | { | 52 | __attribute__ ((warn_unused_result)) |
39 | 51 | qf.reportResult(val); | 53 | make_ready_future() |
23 | 52 | qf.reportFinished(); | ||
24 | 53 | return qf.future(); | ||
25 | 54 | } | ||
26 | 55 | |||
27 | 56 | template<typename T = void> | ||
28 | 57 | QFuture<T> make_ready_future(QFutureInterface<T> qf) | ||
29 | 58 | { | ||
30 | 59 | qf.reportFinished(); | ||
31 | 60 | return qf.future(); | ||
32 | 61 | } | ||
33 | 62 | |||
34 | 63 | template<typename T = void> | ||
35 | 64 | QFuture<T> make_ready_future() | ||
40 | 65 | { | 54 | { |
41 | 66 | QFutureInterface<void> qf; | 55 | QFutureInterface<void> qf; |
42 | 67 | return make_ready_future(qf); | 56 | return make_ready_future(qf); |
43 | 68 | } | 57 | } |
44 | 69 | 58 | ||
45 | 70 | template<typename E> | 59 | template<typename E> |
47 | 71 | QFuture<void> make_exceptional_future(E const& ex) | 60 | QFuture<void> |
48 | 61 | __attribute__ | ||
49 | 62 | ((warn_unused_result)) make_exceptional_future(E const& ex) | ||
50 | 72 | { | 63 | { |
51 | 73 | QFutureInterface<void> qf; | 64 | QFutureInterface<void> qf; |
52 | 74 | qf.reportException(ex); | 65 | qf.reportException(ex); |
53 | @@ -77,7 +68,9 @@ | |||
54 | 77 | } | 68 | } |
55 | 78 | 69 | ||
56 | 79 | template<typename T, typename E> | 70 | template<typename T, typename E> |
58 | 80 | QFuture<T> make_exceptional_future(E const& ex) | 71 | QFuture<T> |
59 | 72 | __attribute__ ((warn_unused_result)) | ||
60 | 73 | make_exceptional_future(E const& ex) | ||
61 | 81 | { | 74 | { |
62 | 82 | QFutureInterface<T> qf; | 75 | QFutureInterface<T> qf; |
63 | 83 | qf.reportException(ex); | 76 | qf.reportException(ex); |
64 | @@ -85,14 +78,6 @@ | |||
65 | 85 | return qf.future(); | 78 | return qf.future(); |
66 | 86 | } | 79 | } |
67 | 87 | 80 | ||
68 | 88 | template<typename T, typename E> | ||
69 | 89 | QFuture<T> make_exceptional_future(QFutureInterface<T> qf, E const& ex) | ||
70 | 90 | { | ||
71 | 91 | qf.reportException(ex); | ||
72 | 92 | qf.reportFinished(); | ||
73 | 93 | return qf.future(); | ||
74 | 94 | } | ||
75 | 95 | |||
76 | 96 | } // namespace internal | 81 | } // namespace internal |
77 | 97 | } // namespace client | 82 | } // namespace client |
78 | 98 | } // namespace qt | 83 | } // namespace qt |
79 | 99 | 84 | ||
80 | === modified file 'include/unity/storage/qt/client/internal/remote_client/Handler.h' | |||
81 | --- include/unity/storage/qt/client/internal/remote_client/Handler.h 2016-08-17 02:55:12 +0000 | |||
82 | +++ include/unity/storage/qt/client/internal/remote_client/Handler.h 2016-09-06 03:34:37 +0000 | |||
83 | @@ -84,21 +84,25 @@ | |||
84 | 84 | catch (LocalCommsException const& e) | 84 | catch (LocalCommsException const& e) |
85 | 85 | { | 85 | { |
86 | 86 | qCritical() << "provider exception:" << e.what(); | 86 | qCritical() << "provider exception:" << e.what(); |
88 | 87 | make_exceptional_future<T>(qf_, e); | 87 | qf_.reportException(e); |
89 | 88 | qf_.reportFinished(); | ||
90 | 88 | } | 89 | } |
91 | 89 | catch (RemoteCommsException const& e) | 90 | catch (RemoteCommsException const& e) |
92 | 90 | { | 91 | { |
93 | 91 | qCritical() << "provider exception:" << e.what(); | 92 | qCritical() << "provider exception:" << e.what(); |
95 | 92 | make_exceptional_future<T>(qf_, e); | 93 | qf_.reportException(e); |
96 | 94 | qf_.reportFinished(); | ||
97 | 93 | } | 95 | } |
98 | 94 | catch (ResourceException const& e) | 96 | catch (ResourceException const& e) |
99 | 95 | { | 97 | { |
100 | 96 | qCritical() << "provider exception:" << e.what(); | 98 | qCritical() << "provider exception:" << e.what(); |
102 | 97 | make_exceptional_future<T>(qf_, e); | 99 | qf_.reportException(e); |
103 | 100 | qf_.reportFinished(); | ||
104 | 98 | } | 101 | } |
105 | 99 | catch (StorageException const& e) | 102 | catch (StorageException const& e) |
106 | 100 | { | 103 | { |
108 | 101 | make_exceptional_future<T>(qf_, e); | 104 | qf_.reportException(e); |
109 | 105 | qf_.reportFinished(); | ||
110 | 102 | } | 106 | } |
111 | 103 | // LCOV_EXCL_START | 107 | // LCOV_EXCL_START |
112 | 104 | catch (...) | 108 | catch (...) |
113 | 105 | 109 | ||
114 | === modified file 'src/qt/client/internal/local_client/DownloaderImpl.cpp' | |||
115 | --- src/qt/client/internal/local_client/DownloaderImpl.cpp 2016-09-01 03:09:40 +0000 | |||
116 | +++ src/qt/client/internal/local_client/DownloaderImpl.cpp 2016-09-06 03:34:37 +0000 | |||
117 | @@ -121,7 +121,7 @@ | |||
118 | 121 | + QString::number(written) + " byte"; | 121 | + QString::number(written) + " byte"; |
119 | 122 | msg += written == 1 ? " was" : "s were"; | 122 | msg += written == 1 ? " was" : "s were"; |
120 | 123 | msg += " consumed."; | 123 | msg += " consumed."; |
122 | 124 | make_exceptional_future(qf_, LogicException(msg)); | 124 | qf_.reportException(LogicException(msg)); |
123 | 125 | } | 125 | } |
124 | 126 | else | 126 | else |
125 | 127 | { | 127 | { |
126 | @@ -136,12 +136,12 @@ | |||
127 | 136 | case cancelled: | 136 | case cancelled: |
128 | 137 | { | 137 | { |
129 | 138 | QString msg = "Downloader::finish_download(): download of " + filename_ + " was cancelled"; | 138 | QString msg = "Downloader::finish_download(): download of " + filename_ + " was cancelled"; |
131 | 139 | make_exceptional_future(qf_, CancelledException(msg)); | 139 | qf_.reportException(CancelledException(msg)); |
132 | 140 | break; | 140 | break; |
133 | 141 | } | 141 | } |
134 | 142 | case error: | 142 | case error: |
135 | 143 | { | 143 | { |
137 | 144 | make_exceptional_future(qf_, ResourceException(error_msg_, error_code_)); | 144 | qf_.reportException(ResourceException(error_msg_, error_code_)); |
138 | 145 | break; | 145 | break; |
139 | 146 | } | 146 | } |
140 | 147 | default: | 147 | default: |
141 | @@ -149,7 +149,7 @@ | |||
142 | 149 | abort(); // LCOV_EXCL_LINE // Impossible | 149 | abort(); // LCOV_EXCL_LINE // Impossible |
143 | 150 | } | 150 | } |
144 | 151 | } | 151 | } |
146 | 152 | make_ready_future(qf_); | 152 | qf_.reportFinished(); |
147 | 153 | QThread::currentThread()->quit(); | 153 | QThread::currentThread()->quit(); |
148 | 154 | } | 154 | } |
149 | 155 | 155 | ||
150 | @@ -268,7 +268,8 @@ | |||
151 | 268 | // LCOV_EXCL_START | 268 | // LCOV_EXCL_START |
152 | 269 | QString msg = "Downloader: cannot create socket pair: " | 269 | QString msg = "Downloader: cannot create socket pair: " |
153 | 270 | + QString::fromStdString(storage::internal::safe_strerror(errno)); | 270 | + QString::fromStdString(storage::internal::safe_strerror(errno)); |
155 | 271 | make_exceptional_future(qf_, ResourceException(msg, errno)); | 271 | qf_.reportException(ResourceException(msg, errno)); |
156 | 272 | qf_.reportFinished(); | ||
157 | 272 | return; | 273 | return; |
158 | 273 | // LCOV_EXCL_STOP | 274 | // LCOV_EXCL_STOP |
159 | 274 | } | 275 | } |
160 | 275 | 276 | ||
161 | === modified file 'src/qt/client/internal/local_client/UploaderImpl.cpp' | |||
162 | --- src/qt/client/internal/local_client/UploaderImpl.cpp 2016-09-01 03:09:40 +0000 | |||
163 | +++ src/qt/client/internal/local_client/UploaderImpl.cpp 2016-09-06 03:34:37 +0000 | |||
164 | @@ -151,7 +151,8 @@ | |||
165 | 151 | { | 151 | { |
166 | 152 | QString msg = "Uploader::finish_upload(): " + path_ + ": upload size of " + QString::number(size_) | 152 | QString msg = "Uploader::finish_upload(): " + path_ + ": upload size of " + QString::number(size_) |
167 | 153 | + " does not match actual number of bytes read: " + QString::number(bytes_read_); | 153 | + " does not match actual number of bytes read: " + QString::number(bytes_read_); |
169 | 154 | make_exceptional_future(qf_, LogicException(msg)); | 154 | qf_.reportException(LogicException(msg)); |
170 | 155 | qf_.reportFinished(); | ||
171 | 155 | } | 156 | } |
172 | 156 | else | 157 | else |
173 | 157 | { | 158 | { |
174 | @@ -167,13 +168,15 @@ | |||
175 | 167 | case cancelled: | 168 | case cancelled: |
176 | 168 | { | 169 | { |
177 | 169 | QString msg = "Uploader::finish_upload(): upload was cancelled"; | 170 | QString msg = "Uploader::finish_upload(): upload was cancelled"; |
179 | 170 | make_exceptional_future(qf_, CancelledException(msg)); | 171 | qf_.reportException(CancelledException(msg)); |
180 | 172 | qf_.reportFinished(); | ||
181 | 171 | break; | 173 | break; |
182 | 172 | } | 174 | } |
183 | 173 | case error: | 175 | case error: |
184 | 174 | { | 176 | { |
185 | 175 | // LCOV_EXCL_START | 177 | // LCOV_EXCL_START |
187 | 176 | make_exceptional_future(qf_, ResourceException(error_msg_, error_code_)); | 178 | qf_.reportException(ResourceException(error_msg_, error_code_)); |
188 | 179 | qf_.reportFinished(); | ||
189 | 177 | break; | 180 | break; |
190 | 178 | // LCOV_EXCL_STOP | 181 | // LCOV_EXCL_STOP |
191 | 179 | } | 182 | } |
192 | @@ -241,7 +244,8 @@ | |||
193 | 241 | if (impl->has_conflict()) | 244 | if (impl->has_conflict()) |
194 | 242 | { | 245 | { |
195 | 243 | state_ = error; | 246 | state_ = error; |
197 | 244 | make_exceptional_future(qf_, ConflictException("Uploader::finish_upload(): ETag mismatch")); | 247 | qf_.reportException(ConflictException("Uploader::finish_upload(): ETag mismatch")); |
198 | 248 | qf_.reportFinished(); | ||
199 | 245 | return; | 249 | return; |
200 | 246 | } | 250 | } |
201 | 247 | } | 251 | } |
202 | @@ -254,7 +258,8 @@ | |||
203 | 254 | state_ = error; | 258 | state_ = error; |
204 | 255 | QString msg = "Uploader::finish_upload(): item with name \"" + path_ + "\" exists already"; | 259 | QString msg = "Uploader::finish_upload(): item with name \"" + path_ + "\" exists already"; |
205 | 256 | QString name = QString::fromStdString(boost::filesystem::path(path_.toStdString()).filename().native()); | 260 | QString name = QString::fromStdString(boost::filesystem::path(path_.toStdString()).filename().native()); |
207 | 257 | make_exceptional_future(qf_, ExistsException(msg, path_, name)); | 261 | qf_.reportException(ExistsException(msg, path_, name)); |
208 | 262 | qf_.reportFinished(); | ||
209 | 258 | return; | 263 | return; |
210 | 259 | } | 264 | } |
211 | 260 | if (close(fd) == -1) | 265 | if (close(fd) == -1) |
212 | @@ -263,7 +268,8 @@ | |||
213 | 263 | state_ = error; | 268 | state_ = error; |
214 | 264 | QString msg = "Uploader::finish_upload(): cannot close tmp file: " | 269 | QString msg = "Uploader::finish_upload(): cannot close tmp file: " |
215 | 265 | + QString::fromStdString(storage::internal::safe_strerror(errno)); | 270 | + QString::fromStdString(storage::internal::safe_strerror(errno)); |
217 | 266 | make_exceptional_future(qf_, ResourceException(msg, errno)); | 271 | qf_.reportException(ResourceException(msg, errno)); |
218 | 272 | qf_.reportFinished(); | ||
219 | 267 | return; | 273 | return; |
220 | 268 | // LCOV_EXCL_STOP | 274 | // LCOV_EXCL_STOP |
221 | 269 | } | 275 | } |
222 | @@ -277,7 +283,8 @@ | |||
223 | 277 | // LCOV_EXCL_START | 283 | // LCOV_EXCL_START |
224 | 278 | state_ = error; | 284 | state_ = error; |
225 | 279 | QString msg = "Uploader::finish_upload(): cannot flush output file: " + output_file_->errorString(); | 285 | QString msg = "Uploader::finish_upload(): cannot flush output file: " + output_file_->errorString(); |
227 | 280 | make_exceptional_future(qf_, ResourceException(msg, output_file_->error())); | 286 | qf_.reportException(ResourceException(msg, output_file_->error())); |
228 | 287 | qf_.reportFinished(); | ||
229 | 281 | return; | 288 | return; |
230 | 282 | // LCOV_EXCL_STOP | 289 | // LCOV_EXCL_STOP |
231 | 283 | } | 290 | } |
232 | @@ -296,7 +303,8 @@ | |||
233 | 296 | QString msg = "Uploader::finish_upload(): linkat \"" + QString::fromStdString(old_path) | 303 | QString msg = "Uploader::finish_upload(): linkat \"" + QString::fromStdString(old_path) |
234 | 297 | + "\" to \"" + file->native_identity() + "\" failed: " | 304 | + "\" to \"" + file->native_identity() + "\" failed: " |
235 | 298 | + QString::fromStdString(storage::internal::safe_strerror(errno)); | 305 | + QString::fromStdString(storage::internal::safe_strerror(errno)); |
237 | 299 | make_exceptional_future(qf_, ResourceException(msg, error_code)); | 306 | qf_.reportException(ResourceException(msg, error_code)); |
238 | 307 | qf_.reportFinished(); | ||
239 | 300 | return; | 308 | return; |
240 | 301 | // LCOV_EXCL_STOP | 309 | // LCOV_EXCL_STOP |
241 | 302 | } | 310 | } |
242 | @@ -312,7 +320,8 @@ | |||
243 | 312 | QString msg = "Uploader::finish_upload(): rename \"" + QString::fromStdString(old_path) | 320 | QString msg = "Uploader::finish_upload(): rename \"" + QString::fromStdString(old_path) |
244 | 313 | + "\" to \"" + file->native_identity() + "\" failed: " | 321 | + "\" to \"" + file->native_identity() + "\" failed: " |
245 | 314 | + QString::fromStdString(storage::internal::safe_strerror(errno)); | 322 | + QString::fromStdString(storage::internal::safe_strerror(errno)); |
247 | 315 | make_exceptional_future(qf_, ResourceException(msg, error_code)); | 323 | qf_.reportException(ResourceException(msg, error_code)); |
248 | 324 | qf_.reportFinished(); | ||
249 | 316 | return; | 325 | return; |
250 | 317 | } | 326 | } |
251 | 318 | // LCOV_EXCL_STOP | 327 | // LCOV_EXCL_STOP |
252 | @@ -321,7 +330,8 @@ | |||
253 | 321 | state_ = finalized; | 330 | state_ = finalized; |
254 | 322 | output_file_->close(); | 331 | output_file_->close(); |
255 | 323 | impl->set_timestamps(); | 332 | impl->set_timestamps(); |
257 | 324 | make_ready_future(qf_, file); | 333 | qf_.reportResult(file); |
258 | 334 | qf_.reportFinished(); | ||
259 | 325 | } | 335 | } |
260 | 326 | 336 | ||
261 | 327 | // LCOV_EXCL_START | 337 | // LCOV_EXCL_START |
262 | @@ -366,7 +376,8 @@ | |||
263 | 366 | // LCOV_EXCL_START | 376 | // LCOV_EXCL_START |
264 | 367 | QString msg = "Uploader: cannot create socket pair: " | 377 | QString msg = "Uploader: cannot create socket pair: " |
265 | 368 | + QString::fromStdString(storage::internal::safe_strerror(errno)); | 378 | + QString::fromStdString(storage::internal::safe_strerror(errno)); |
267 | 369 | make_exceptional_future(qf_, ResourceException(msg, errno)); | 379 | qf_.reportException(ResourceException(msg, errno)); |
268 | 380 | qf_.reportFinished(); | ||
269 | 370 | return; | 381 | return; |
270 | 371 | // LCOV_EXCL_STOP | 382 | // LCOV_EXCL_STOP |
271 | 372 | } | 383 | } |
272 | 373 | 384 | ||
273 | === modified file 'src/qt/client/internal/remote_client/AccountImpl.cpp' | |||
274 | --- src/qt/client/internal/remote_client/AccountImpl.cpp 2016-08-22 04:56:44 +0000 | |||
275 | +++ src/qt/client/internal/remote_client/AccountImpl.cpp 2016-09-06 03:34:37 +0000 | |||
276 | @@ -96,7 +96,8 @@ | |||
277 | 96 | } | 96 | } |
278 | 97 | catch (RuntimeDestroyedException const& e) | 97 | catch (RuntimeDestroyedException const& e) |
279 | 98 | { | 98 | { |
281 | 99 | make_exceptional_future(qf, RuntimeDestroyedException("Account::roots()")); | 99 | qf.reportException(RuntimeDestroyedException("Account::roots()")); |
282 | 100 | qf.reportFinished(); | ||
283 | 100 | return; | 101 | return; |
284 | 101 | } | 102 | } |
285 | 102 | 103 | ||
286 | @@ -113,7 +114,8 @@ | |||
287 | 113 | roots.append(root); | 114 | roots.append(root); |
288 | 114 | } | 115 | } |
289 | 115 | roots_ = roots; | 116 | roots_ = roots; |
291 | 116 | make_ready_future(qf, roots); | 117 | qf.reportResult(roots); |
292 | 118 | qf.reportFinished(); | ||
293 | 117 | }; | 119 | }; |
294 | 118 | 120 | ||
295 | 119 | auto handler = new Handler<QVector<Root::SPtr>>(this, reply, process_reply); | 121 | auto handler = new Handler<QVector<Root::SPtr>>(this, reply, process_reply); |
296 | 120 | 122 | ||
297 | === modified file 'src/qt/client/internal/remote_client/DownloaderImpl.cpp' | |||
298 | --- src/qt/client/internal/remote_client/DownloaderImpl.cpp 2016-09-01 03:09:40 +0000 | |||
299 | +++ src/qt/client/internal/remote_client/DownloaderImpl.cpp 2016-09-06 03:34:37 +0000 | |||
300 | @@ -81,7 +81,7 @@ | |||
301 | 81 | 81 | ||
302 | 82 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) | 82 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) |
303 | 83 | { | 83 | { |
305 | 84 | make_ready_future(qf); | 84 | qf.reportFinished(); |
306 | 85 | }; | 85 | }; |
307 | 86 | 86 | ||
308 | 87 | auto handler = new Handler<void>(this, reply, process_reply); | 87 | auto handler = new Handler<void>(this, reply, process_reply); |
309 | 88 | 88 | ||
310 | === modified file 'src/qt/client/internal/remote_client/FileImpl.cpp' | |||
311 | --- src/qt/client/internal/remote_client/FileImpl.cpp 2016-08-11 07:06:35 +0000 | |||
312 | +++ src/qt/client/internal/remote_client/FileImpl.cpp 2016-09-06 03:34:37 +0000 | |||
313 | @@ -80,7 +80,8 @@ | |||
314 | 80 | auto root = get_root(); | 80 | auto root = get_root(); |
315 | 81 | if (!root) | 81 | if (!root) |
316 | 82 | { | 82 | { |
318 | 83 | make_exceptional_future(qf, RuntimeDestroyedException("File::create_uploader()")); | 83 | qf.reportException(RuntimeDestroyedException("File::create_uploader()")); |
319 | 84 | qf.reportFinished(); | ||
320 | 84 | return; | 85 | return; |
321 | 85 | } | 86 | } |
322 | 86 | 87 | ||
323 | @@ -91,11 +92,13 @@ | |||
324 | 91 | // TODO: log server error here | 92 | // TODO: log server error here |
325 | 92 | QString msg = "File::create_uploader(): impossible file descriptor returned by server: " | 93 | QString msg = "File::create_uploader(): impossible file descriptor returned by server: " |
326 | 93 | + QString::number(fd.fileDescriptor()); | 94 | + QString::number(fd.fileDescriptor()); |
328 | 94 | make_exceptional_future(qf, LocalCommsException(msg)); | 95 | qf.reportException(LocalCommsException(msg)); |
329 | 96 | qf.reportFinished(); | ||
330 | 95 | return; | 97 | return; |
331 | 96 | } | 98 | } |
332 | 97 | auto uploader = UploaderImpl::make_uploader(upload_id, fd, size, old_etag, root, prov); | 99 | auto uploader = UploaderImpl::make_uploader(upload_id, fd, size, old_etag, root, prov); |
334 | 98 | make_ready_future(qf, uploader); | 100 | qf.reportResult(uploader); |
335 | 101 | qf.reportFinished(); | ||
336 | 99 | }; | 102 | }; |
337 | 100 | auto handler = new Handler<shared_ptr<Uploader>>(this, reply, process_reply); | 103 | auto handler = new Handler<shared_ptr<Uploader>>(this, reply, process_reply); |
338 | 101 | return handler->future(); | 104 | return handler->future(); |
339 | @@ -124,7 +127,9 @@ | |||
340 | 124 | } | 127 | } |
341 | 125 | catch (StorageException const& e) | 128 | catch (StorageException const& e) |
342 | 126 | { | 129 | { |
344 | 127 | make_exceptional_future(qf, e); | 130 | qf.reportException(e); |
345 | 131 | qf.reportFinished(); | ||
346 | 132 | return; | ||
347 | 128 | } | 133 | } |
348 | 129 | 134 | ||
349 | 130 | auto download_id = reply.argumentAt<0>(); | 135 | auto download_id = reply.argumentAt<0>(); |
350 | @@ -134,13 +139,15 @@ | |||
351 | 134 | // TODO: log server error here | 139 | // TODO: log server error here |
352 | 135 | QString msg = "File::create_downloader(): impossible file descriptor returned by server: " | 140 | QString msg = "File::create_downloader(): impossible file descriptor returned by server: " |
353 | 136 | + QString::number(fd.fileDescriptor()); | 141 | + QString::number(fd.fileDescriptor()); |
355 | 137 | make_exceptional_future(qf, LocalCommsException(msg)); | 142 | qf.reportException(LocalCommsException(msg)); |
356 | 143 | qf.reportFinished(); | ||
357 | 138 | return; | 144 | return; |
358 | 139 | } | 145 | } |
359 | 140 | auto file = dynamic_pointer_cast<File>(public_instance_.lock()); | 146 | auto file = dynamic_pointer_cast<File>(public_instance_.lock()); |
360 | 141 | // TODO: provider may not be around anymore if the runtime was destroyed. | 147 | // TODO: provider may not be around anymore if the runtime was destroyed. |
361 | 142 | auto downloader = DownloaderImpl::make_downloader(download_id, fd, file, prov); | 148 | auto downloader = DownloaderImpl::make_downloader(download_id, fd, file, prov); |
363 | 143 | make_ready_future(qf, downloader); | 149 | qf.reportResult(downloader); |
364 | 150 | qf.reportFinished(); | ||
365 | 144 | }; | 151 | }; |
366 | 145 | 152 | ||
367 | 146 | auto handler = new Handler<shared_ptr<Downloader>>(this, reply, process_reply); | 153 | auto handler = new Handler<shared_ptr<Downloader>>(this, reply, process_reply); |
368 | 147 | 154 | ||
369 | === modified file 'src/qt/client/internal/remote_client/FolderImpl.cpp' | |||
370 | --- src/qt/client/internal/remote_client/FolderImpl.cpp 2016-08-09 02:25:13 +0000 | |||
371 | +++ src/qt/client/internal/remote_client/FolderImpl.cpp 2016-09-06 03:34:37 +0000 | |||
372 | @@ -78,7 +78,8 @@ | |||
373 | 78 | auto root = get_root(); | 78 | auto root = get_root(); |
374 | 79 | if (!root) | 79 | if (!root) |
375 | 80 | { | 80 | { |
377 | 81 | make_exceptional_future(qf, RuntimeDestroyedException("Folder::list()")); | 81 | qf.reportException(RuntimeDestroyedException("Folder::list()")); |
378 | 82 | qf.reportFinished(); | ||
379 | 82 | return; | 83 | return; |
380 | 83 | } | 84 | } |
381 | 84 | 85 | ||
382 | @@ -92,7 +93,8 @@ | |||
383 | 92 | } | 93 | } |
384 | 93 | catch (StorageException const& e) | 94 | catch (StorageException const& e) |
385 | 94 | { | 95 | { |
387 | 95 | make_exceptional_future(qf, e); | 96 | qf.reportException(e); |
388 | 97 | qf.reportFinished(); | ||
389 | 96 | return; | 98 | return; |
390 | 97 | } | 99 | } |
391 | 98 | if (md.type == ItemType::root) | 100 | if (md.type == ItemType::root) |
392 | @@ -140,7 +142,8 @@ | |||
393 | 140 | auto root = get_root(); | 142 | auto root = get_root(); |
394 | 141 | if (!root) | 143 | if (!root) |
395 | 142 | { | 144 | { |
397 | 143 | make_exceptional_future(qf, RuntimeDestroyedException("Folder::lookup()")); | 145 | qf.reportException(RuntimeDestroyedException("Folder::lookup()")); |
398 | 146 | qf.reportFinished(); | ||
399 | 144 | return; | 147 | return; |
400 | 145 | } | 148 | } |
401 | 146 | 149 | ||
402 | @@ -154,7 +157,8 @@ | |||
403 | 154 | } | 157 | } |
404 | 155 | catch (StorageException const& e) | 158 | catch (StorageException const& e) |
405 | 156 | { | 159 | { |
407 | 157 | make_exceptional_future(qf, e); | 160 | qf.reportException(e); |
408 | 161 | qf.reportFinished(); | ||
409 | 158 | return; | 162 | return; |
410 | 159 | } | 163 | } |
411 | 160 | if (md.type == ItemType::root) | 164 | if (md.type == ItemType::root) |
412 | @@ -166,10 +170,12 @@ | |||
413 | 166 | } | 170 | } |
414 | 167 | if (items.isEmpty()) | 171 | if (items.isEmpty()) |
415 | 168 | { | 172 | { |
417 | 169 | make_exceptional_future(qf, NotExistsException("Folder::lookup(): no such item: " + name, name)); | 173 | qf.reportException(NotExistsException("Folder::lookup(): no such item: " + name, name)); |
418 | 174 | qf.reportFinished(); | ||
419 | 170 | return; | 175 | return; |
420 | 171 | } | 176 | } |
422 | 172 | make_ready_future(qf, items); | 177 | qf.reportResult(items); |
423 | 178 | qf.reportFinished(); | ||
424 | 173 | }; | 179 | }; |
425 | 174 | 180 | ||
426 | 175 | auto handler = new Handler<QVector<shared_ptr<Item>>>(const_cast<FolderImpl*>(this), reply, process_reply); | 181 | auto handler = new Handler<QVector<shared_ptr<Item>>>(const_cast<FolderImpl*>(this), reply, process_reply); |
427 | @@ -195,7 +201,8 @@ | |||
428 | 195 | auto root = get_root(); | 201 | auto root = get_root(); |
429 | 196 | if (!root) | 202 | if (!root) |
430 | 197 | { | 203 | { |
432 | 198 | make_exceptional_future(qf, RuntimeDestroyedException("Folder::create_folder()")); | 204 | qf.reportException(RuntimeDestroyedException("Folder::create_folder()")); |
433 | 205 | qf.reportFinished(); | ||
434 | 199 | return; | 206 | return; |
435 | 200 | } | 207 | } |
436 | 201 | 208 | ||
437 | @@ -207,7 +214,8 @@ | |||
438 | 207 | } | 214 | } |
439 | 208 | catch (StorageException const& e) | 215 | catch (StorageException const& e) |
440 | 209 | { | 216 | { |
442 | 210 | make_exceptional_future(qf, e); | 217 | qf.reportException(e); |
443 | 218 | qf.reportFinished(); | ||
444 | 211 | return; | 219 | return; |
445 | 212 | } | 220 | } |
446 | 213 | if (md.type != ItemType::folder) | 221 | if (md.type != ItemType::folder) |
447 | @@ -215,10 +223,12 @@ | |||
448 | 215 | // TODO: log server error here | 223 | // TODO: log server error here |
449 | 216 | QString msg = "File::create_folder(): impossible item type returned by server: " | 224 | QString msg = "File::create_folder(): impossible item type returned by server: " |
450 | 217 | + QString::number(int(md.type)); | 225 | + QString::number(int(md.type)); |
452 | 218 | make_exceptional_future(qf, LocalCommsException(msg)); | 226 | qf.reportException(LocalCommsException(msg)); |
453 | 227 | qf.reportFinished(); | ||
454 | 219 | return; | 228 | return; |
455 | 220 | } | 229 | } |
457 | 221 | make_ready_future(qf, FolderImpl::make_folder(md, root)); | 230 | qf.reportResult(FolderImpl::make_folder(md, root)); |
458 | 231 | qf.reportFinished(); | ||
459 | 222 | }; | 232 | }; |
460 | 223 | 233 | ||
461 | 224 | auto handler = new Handler<shared_ptr<Folder>>(this, reply, process_reply); | 234 | auto handler = new Handler<shared_ptr<Folder>>(this, reply, process_reply); |
462 | @@ -249,14 +259,16 @@ | |||
463 | 249 | auto root = get_root(); | 259 | auto root = get_root(); |
464 | 250 | if (!root) | 260 | if (!root) |
465 | 251 | { | 261 | { |
467 | 252 | make_exceptional_future(qf, RuntimeDestroyedException("Folder::create_file()")); | 262 | qf.reportException(RuntimeDestroyedException("Folder::create_file()")); |
468 | 263 | qf.reportFinished(); | ||
469 | 253 | return; | 264 | return; |
470 | 254 | } | 265 | } |
471 | 255 | 266 | ||
472 | 256 | auto upload_id = reply.argumentAt<0>(); | 267 | auto upload_id = reply.argumentAt<0>(); |
473 | 257 | auto fd = reply.argumentAt<1>(); | 268 | auto fd = reply.argumentAt<1>(); |
474 | 258 | auto uploader = UploaderImpl::make_uploader(upload_id, fd, size, "", root, provider()); | 269 | auto uploader = UploaderImpl::make_uploader(upload_id, fd, size, "", root, provider()); |
476 | 259 | make_ready_future(qf, uploader); | 270 | qf.reportResult(uploader); |
477 | 271 | qf.reportFinished(); | ||
478 | 260 | }; | 272 | }; |
479 | 261 | 273 | ||
480 | 262 | auto handler = new Handler<shared_ptr<Uploader>>(this, reply, process_reply); | 274 | auto handler = new Handler<shared_ptr<Uploader>>(this, reply, process_reply); |
481 | 263 | 275 | ||
482 | === modified file 'src/qt/client/internal/remote_client/ItemImpl.cpp' | |||
483 | --- src/qt/client/internal/remote_client/ItemImpl.cpp 2016-08-09 07:04:11 +0000 | |||
484 | +++ src/qt/client/internal/remote_client/ItemImpl.cpp 2016-09-06 03:34:37 +0000 | |||
485 | @@ -102,7 +102,8 @@ | |||
486 | 102 | auto root = get_root(); | 102 | auto root = get_root(); |
487 | 103 | if (!root) | 103 | if (!root) |
488 | 104 | { | 104 | { |
490 | 105 | make_exceptional_future(qf, RuntimeDestroyedException("Item::copy()")); | 105 | qf.reportException(RuntimeDestroyedException("Item::copy()")); |
491 | 106 | qf.reportFinished(); | ||
492 | 106 | return; | 107 | return; |
493 | 107 | } | 108 | } |
494 | 108 | 109 | ||
495 | @@ -113,7 +114,8 @@ | |||
496 | 113 | } | 114 | } |
497 | 114 | catch (StorageException const& e) | 115 | catch (StorageException const& e) |
498 | 115 | { | 116 | { |
500 | 116 | make_exceptional_future(qf, e); | 117 | qf.reportException(e); |
501 | 118 | qf.reportFinished(); | ||
502 | 117 | return; | 119 | return; |
503 | 118 | } | 120 | } |
504 | 119 | if (md.type == ItemType::root) | 121 | if (md.type == ItemType::root) |
505 | @@ -121,10 +123,12 @@ | |||
506 | 121 | // TODO: log server error here | 123 | // TODO: log server error here |
507 | 122 | QString msg = "File::create_folder(): impossible item type returned by server: " | 124 | QString msg = "File::create_folder(): impossible item type returned by server: " |
508 | 123 | + QString::number(int(md.type)); | 125 | + QString::number(int(md.type)); |
510 | 124 | make_exceptional_future(qf, LocalCommsException(msg)); | 126 | qf.reportException(LocalCommsException(msg)); |
511 | 127 | qf.reportFinished(); | ||
512 | 125 | return; | 128 | return; |
513 | 126 | } | 129 | } |
515 | 127 | make_ready_future(qf, ItemImpl::make_item(md, root)); | 130 | qf.reportResult(ItemImpl::make_item(md, root)); |
516 | 131 | qf.reportFinished(); | ||
517 | 128 | return; | 132 | return; |
518 | 129 | }; | 133 | }; |
519 | 130 | 134 | ||
520 | @@ -163,7 +167,8 @@ | |||
521 | 163 | auto root = get_root(); | 167 | auto root = get_root(); |
522 | 164 | if (!root) | 168 | if (!root) |
523 | 165 | { | 169 | { |
525 | 166 | make_exceptional_future(qf, RuntimeDestroyedException("Item::move()")); | 170 | qf.reportException(RuntimeDestroyedException("Item::move()")); |
526 | 171 | qf.reportFinished(); | ||
527 | 167 | return; | 172 | return; |
528 | 168 | } | 173 | } |
529 | 169 | 174 | ||
530 | @@ -174,17 +179,20 @@ | |||
531 | 174 | } | 179 | } |
532 | 175 | catch (StorageException const& e) | 180 | catch (StorageException const& e) |
533 | 176 | { | 181 | { |
535 | 177 | make_exceptional_future(qf, e); | 182 | qf.reportException(e); |
536 | 183 | qf.reportFinished(); | ||
537 | 178 | return; | 184 | return; |
538 | 179 | } | 185 | } |
539 | 180 | if (md.type == ItemType::root) | 186 | if (md.type == ItemType::root) |
540 | 181 | { | 187 | { |
541 | 182 | // TODO: log server error here | 188 | // TODO: log server error here |
542 | 183 | QString msg = "Item::move(): impossible root item returned by server"; | 189 | QString msg = "Item::move(): impossible root item returned by server"; |
544 | 184 | make_exceptional_future(qf, LocalCommsException(msg)); | 190 | qf.reportException(LocalCommsException(msg)); |
545 | 191 | qf.reportFinished(); | ||
546 | 185 | return; | 192 | return; |
547 | 186 | } | 193 | } |
549 | 187 | make_ready_future(qf, ItemImpl::make_item(md, root)); | 194 | qf.reportResult(ItemImpl::make_item(md, root)); |
550 | 195 | qf.reportFinished(); | ||
551 | 188 | }; | 196 | }; |
552 | 189 | 197 | ||
553 | 190 | auto handler = new Handler<shared_ptr<Item>>(this, reply, process_reply); | 198 | auto handler = new Handler<shared_ptr<Item>>(this, reply, process_reply); |
554 | @@ -229,7 +237,7 @@ | |||
555 | 229 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) | 237 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) |
556 | 230 | { | 238 | { |
557 | 231 | deleted_ = true; | 239 | deleted_ = true; |
559 | 232 | make_ready_future(qf); | 240 | qf.reportFinished(); |
560 | 233 | }; | 241 | }; |
561 | 234 | 242 | ||
562 | 235 | auto handler = new Handler<void>(this, reply, process_reply); | 243 | auto handler = new Handler<void>(this, reply, process_reply); |
563 | 236 | 244 | ||
564 | === modified file 'src/qt/client/internal/remote_client/RootImpl.cpp' | |||
565 | --- src/qt/client/internal/remote_client/RootImpl.cpp 2016-08-09 02:25:13 +0000 | |||
566 | +++ src/qt/client/internal/remote_client/RootImpl.cpp 2016-09-06 03:34:37 +0000 | |||
567 | @@ -133,7 +133,8 @@ | |||
568 | 133 | } | 133 | } |
569 | 134 | catch (RuntimeDestroyedException const&) | 134 | catch (RuntimeDestroyedException const&) |
570 | 135 | { | 135 | { |
572 | 136 | make_exceptional_future(qf, RuntimeDestroyedException("Root::get()")); | 136 | qf.reportException(RuntimeDestroyedException("Root::get()")); |
573 | 137 | qf.reportFinished(); | ||
574 | 137 | return; | 138 | return; |
575 | 138 | } | 139 | } |
576 | 139 | 140 | ||
577 | @@ -144,7 +145,8 @@ | |||
578 | 144 | } | 145 | } |
579 | 145 | catch (StorageException const& e) | 146 | catch (StorageException const& e) |
580 | 146 | { | 147 | { |
582 | 147 | make_exceptional_future(qf, e); | 148 | qf.reportException(e); |
583 | 149 | qf.reportFinished(); | ||
584 | 148 | return; | 150 | return; |
585 | 149 | } | 151 | } |
586 | 150 | Item::SPtr item; | 152 | Item::SPtr item; |
587 | @@ -157,7 +159,8 @@ | |||
588 | 157 | // acc owns the root, so the root weak_ptr is guaranteed to be lockable. | 159 | // acc owns the root, so the root weak_ptr is guaranteed to be lockable. |
589 | 158 | item = ItemImpl::make_item(md, root_); | 160 | item = ItemImpl::make_item(md, root_); |
590 | 159 | } | 161 | } |
592 | 160 | make_ready_future(qf, item); | 162 | qf.reportResult(item); |
593 | 163 | qf.reportFinished(); | ||
594 | 161 | }; | 164 | }; |
595 | 162 | 165 | ||
596 | 163 | auto handler = new Handler<Item::SPtr>(const_cast<RootImpl*>(this), reply, process_reply); | 166 | auto handler = new Handler<Item::SPtr>(const_cast<RootImpl*>(this), reply, process_reply); |
597 | 164 | 167 | ||
598 | === modified file 'src/qt/client/internal/remote_client/RuntimeImpl.cpp' | |||
599 | --- src/qt/client/internal/remote_client/RuntimeImpl.cpp 2016-08-19 06:18:54 +0000 | |||
600 | +++ src/qt/client/internal/remote_client/RuntimeImpl.cpp 2016-09-06 03:34:37 +0000 | |||
601 | @@ -105,7 +105,9 @@ | |||
602 | 105 | { | 105 | { |
603 | 106 | if (destroyed_) | 106 | if (destroyed_) |
604 | 107 | { | 107 | { |
606 | 108 | return make_exceptional_future(qf_, RuntimeDestroyedException("Runtime::accounts()")); | 108 | qf_.reportException(RuntimeDestroyedException("Runtime::accounts()")); |
607 | 109 | qf_.reportFinished(); | ||
608 | 110 | return qf_.future(); | ||
609 | 109 | } | 111 | } |
610 | 110 | 112 | ||
611 | 111 | if (!manager_) | 113 | if (!manager_) |
612 | @@ -131,7 +133,8 @@ | |||
613 | 131 | if (destroyed_) | 133 | if (destroyed_) |
614 | 132 | { | 134 | { |
615 | 133 | // LCOV_EXCL_START | 135 | // LCOV_EXCL_START |
617 | 134 | make_exceptional_future(qf_, RuntimeDestroyedException("Runtime::accounts()")); | 136 | qf_.reportException(RuntimeDestroyedException("Runtime::accounts()")); |
618 | 137 | qf_.reportFinished(); | ||
619 | 135 | return; | 138 | return; |
620 | 136 | // LCOV_EXCL_STOP | 139 | // LCOV_EXCL_STOP |
621 | 137 | } | 140 | } |
622 | @@ -161,20 +164,22 @@ | |||
623 | 161 | } | 164 | } |
624 | 162 | } | 165 | } |
625 | 163 | accounts_ = accounts; | 166 | accounts_ = accounts; |
627 | 164 | make_ready_future(qf_, accounts); | 167 | qf_.reportResult(accounts); |
628 | 165 | } | 168 | } |
629 | 166 | // LCOV_EXCL_START | 169 | // LCOV_EXCL_START |
630 | 167 | catch (StorageException const& e) | 170 | catch (StorageException const& e) |
631 | 168 | { | 171 | { |
633 | 169 | make_exceptional_future(qf_, e); | 172 | qf_.reportException(e); |
634 | 170 | } | 173 | } |
635 | 171 | // LCOV_EXCL_STOP | 174 | // LCOV_EXCL_STOP |
636 | 175 | qf_.reportFinished(); | ||
637 | 172 | } | 176 | } |
638 | 173 | 177 | ||
639 | 174 | // LCOV_EXCL_START | 178 | // LCOV_EXCL_START |
640 | 175 | void RuntimeImpl::timeout() | 179 | void RuntimeImpl::timeout() |
641 | 176 | { | 180 | { |
643 | 177 | make_exceptional_future(qf_, ResourceException("Runtime::accounts(): timeout retrieving Online accounts", 0)); | 181 | qf_.reportException(ResourceException("Runtime::accounts(): timeout retrieving Online accounts", 0)); |
644 | 182 | qf_.reportFinished(); | ||
645 | 178 | } | 183 | } |
646 | 179 | // LCOV_EXCL_STOP | 184 | // LCOV_EXCL_STOP |
647 | 180 | 185 | ||
648 | 181 | 186 | ||
649 | === modified file 'src/qt/client/internal/remote_client/UploaderImpl.cpp' | |||
650 | --- src/qt/client/internal/remote_client/UploaderImpl.cpp 2016-09-01 03:09:40 +0000 | |||
651 | +++ src/qt/client/internal/remote_client/UploaderImpl.cpp 2016-09-06 03:34:37 +0000 | |||
652 | @@ -92,7 +92,8 @@ | |||
653 | 92 | } | 92 | } |
654 | 93 | catch (StorageException const& e) | 93 | catch (StorageException const& e) |
655 | 94 | { | 94 | { |
657 | 95 | make_exceptional_future(qf, e); | 95 | qf.reportException(e); |
658 | 96 | qf.reportFinished(); | ||
659 | 96 | return; | 97 | return; |
660 | 97 | } | 98 | } |
661 | 98 | if (md.type != ItemType::file) | 99 | if (md.type != ItemType::file) |
662 | @@ -100,10 +101,12 @@ | |||
663 | 100 | // TODO: log server error here | 101 | // TODO: log server error here |
664 | 101 | QString msg = "Uploader::finish_upload(): impossible item type returned by server: " | 102 | QString msg = "Uploader::finish_upload(): impossible item type returned by server: " |
665 | 102 | + QString::number(int(md.type)); | 103 | + QString::number(int(md.type)); |
667 | 103 | make_exceptional_future(qf, LocalCommsException(msg)); | 104 | qf.reportException(LocalCommsException(msg)); |
668 | 105 | qf.reportFinished(); | ||
669 | 104 | return; | 106 | return; |
670 | 105 | } | 107 | } |
672 | 106 | make_ready_future(qf, FileImpl::make_file(md, root_)); | 108 | qf.reportResult(FileImpl::make_file(md, root_)); |
673 | 109 | qf.reportFinished(); | ||
674 | 107 | }; | 110 | }; |
675 | 108 | 111 | ||
676 | 109 | write_socket_->disconnectFromServer(); | 112 | write_socket_->disconnectFromServer(); |
677 | @@ -118,7 +121,7 @@ | |||
678 | 118 | auto reply = provider_->CancelUpload(upload_id_); | 121 | auto reply = provider_->CancelUpload(upload_id_); |
679 | 119 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) | 122 | auto process_reply = [this](decltype(reply) const&, QFutureInterface<void>& qf) |
680 | 120 | { | 123 | { |
682 | 121 | make_ready_future(qf); | 124 | qf.reportFinished(); |
683 | 122 | }; | 125 | }; |
684 | 123 | 126 | ||
685 | 124 | write_socket_->abort(); | 127 | write_socket_->abort(); |
686 | 125 | 128 | ||
687 | === modified file 'tests/local-client/local-client_test.cpp' | |||
688 | --- tests/local-client/local-client_test.cpp 2016-08-25 04:05:18 +0000 | |||
689 | +++ tests/local-client/local-client_test.cpp 2016-09-06 03:34:37 +0000 | |||
690 | @@ -425,7 +425,6 @@ | |||
691 | 425 | EXPECT_EQ(0, file->size()); | 425 | EXPECT_EQ(0, file->size()); |
692 | 426 | auto old_etag = file->etag(); | 426 | auto old_etag = file->etag(); |
693 | 427 | 427 | ||
694 | 428 | qDebug() << "Uploading 0 bytes"; | ||
695 | 429 | // Create uploader for the file and write nothing. | 428 | // Create uploader for the file and write nothing. |
696 | 430 | uploader = call(file->create_uploader(ConflictPolicy::overwrite, 0)); | 429 | uploader = call(file->create_uploader(ConflictPolicy::overwrite, 0)); |
697 | 431 | file = call(uploader->finish_upload()); | 430 | file = call(uploader->finish_upload()); |
698 | @@ -436,7 +435,6 @@ | |||
699 | 436 | uploader = call(file->create_uploader(ConflictPolicy::overwrite, s.size())); | 435 | uploader = call(file->create_uploader(ConflictPolicy::overwrite, s.size())); |
700 | 437 | EXPECT_EQ(1000000, uploader->size()); | 436 | EXPECT_EQ(1000000, uploader->size()); |
701 | 438 | uploader->socket()->write(&s[0], s.size()); | 437 | uploader->socket()->write(&s[0], s.size()); |
702 | 439 | qDebug() << "Waiting for write to complete"; | ||
703 | 440 | uploader->socket()->waitForBytesWritten(SIGNAL_WAIT_TIME); | 438 | uploader->socket()->waitForBytesWritten(SIGNAL_WAIT_TIME); |
704 | 441 | 439 | ||
705 | 442 | // Need to sleep here, otherwise it is possible for the | 440 | // Need to sleep here, otherwise it is possible for the |
PASSED: Continuous integration, rev:68 /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/101/ /jenkins. canonical. com/unity- api-1/job/ build/508 /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/514 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= vivid+overlay/ 419 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= xenial+ overlay/ 419 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= yakkety/ 419 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 349/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= yakkety/ 349 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= yakkety/ 349/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/101/ rebuild
https:/