Merge lp:~jamesh/thumbnailer/bug-1467751 into lp:thumbnailer/devel

Proposed by James Henstridge
Status: Merged
Approved by: James Henstridge
Approved revision: 233
Merged at revision: 234
Proposed branch: lp:~jamesh/thumbnailer/bug-1467751
Merge into: lp:thumbnailer/devel
Diff against target: 66 lines (+2/-9)
1 file modified
src/service/handler.cpp (+2/-9)
To merge this branch: bzr merge lp:~jamesh/thumbnailer/bug-1467751
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+262660@code.launchpad.net

This proposal supersedes a proposal from 2015-06-23.

Commit message

Set finish_time within the Handler::sendThumbnail and sendError methods so it is guaranteed to be set before the finished signal is emitted.

Description of the change

Set finish_time within the Handler::sendThumbnail and sendError methods so it is guaranteed to be set before the finished signal is emitted.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

This is a big improvement, thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~jamesh/thumbnailer/bug-1467751 updated
233. By James Henstridge

Merge from devel, fixing conflicts

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/service/handler.cpp'
--- src/service/handler.cpp 2015-06-22 10:18:13 +0000
+++ src/service/handler.cpp 2015-06-23 08:34:17 +0000
@@ -252,8 +252,6 @@
252252
253void Handler::checkFinished()253void Handler::checkFinished()
254{254{
255 p->finish_time = chrono::system_clock::now(); // Set finish_time in case something below throws.
256
257 if (p->cancelled)255 if (p->cancelled)
258 {256 {
259 return;257 return;
@@ -281,8 +279,6 @@
281 if (fd_error.fd.isValid())279 if (fd_error.fd.isValid())
282 {280 {
283 sendThumbnail(fd_error.fd);281 sendThumbnail(fd_error.fd);
284 // Set time again, because sending the thumbnail could take a while.
285 p->finish_time = chrono::system_clock::now();
286 return;282 return;
287 }283 }
288284
@@ -297,14 +293,12 @@
297 // LCOV_EXCL_START293 // LCOV_EXCL_START
298 catch (std::exception const& e)294 catch (std::exception const& e)
299 {295 {
300 p->finish_time = chrono::system_clock::now();
301 sendError("Handler::checkFinished(): download error: " + details() + e.what());296 sendError("Handler::checkFinished(): download error: " + details() + e.what());
302 }297 }
303 // LCOV_EXCL_STOP298 // LCOV_EXCL_STOP
304 return;299 return;
305 }300 }
306301
307 p->finish_time = chrono::system_clock::now();
308 sendError("Handler::check_finished(): no artwork for " + details() + ": " + status());302 sendError("Handler::check_finished(): no artwork for " + details() + ": " + status());
309}303}
310304
@@ -350,8 +344,6 @@
350344
351void Handler::createFinished()345void Handler::createFinished()
352{346{
353 // Set finish_time in case something below throws.
354 p->finish_time = chrono::system_clock::now();
355 if (p->cancelled)347 if (p->cancelled)
356 {348 {
357 return;349 return;
@@ -382,12 +374,12 @@
382 {374 {
383 sendError("Handler::createFinished(): invalid file descriptor for " + details()); // LCOV_EXCL_LINE375 sendError("Handler::createFinished(): invalid file descriptor for " + details()); // LCOV_EXCL_LINE
384 }376 }
385 p->finish_time = chrono::system_clock::now();
386}377}
387378
388void Handler::sendThumbnail(QDBusUnixFileDescriptor const& unix_fd)379void Handler::sendThumbnail(QDBusUnixFileDescriptor const& unix_fd)
389{380{
390 p->bus.send(p->message.createReply(QVariant::fromValue(unix_fd)));381 p->bus.send(p->message.createReply(QVariant::fromValue(unix_fd)));
382 p->finish_time = chrono::system_clock::now();
391 Q_EMIT finished();383 Q_EMIT finished();
392}384}
393385
@@ -398,6 +390,7 @@
398 qWarning() << error;390 qWarning() << error;
399 }391 }
400 p->bus.send(p->message.createErrorReply(ART_ERROR, error));392 p->bus.send(p->message.createErrorReply(ART_ERROR, error));
393 p->finish_time = chrono::system_clock::now();
401 Q_EMIT finished();394 Q_EMIT finished();
402}395}
403396

Subscribers

People subscribed via source and target branches

to all changes: