Fix tests.
[dcpomatic.git] / src / lib / job.cc
index 4969c4099c8aae60a4e7c22db6618ded9c8a1c93..080d1eaf6018a5588c9d9f0c31a63c894585a4a1 100644 (file)
@@ -27,6 +27,7 @@
 #include "job.h"
 #include "util.h"
 #include "cross.h"
+#include "ui_signaller.h"
 
 #include "i18n.h"
 
@@ -170,8 +171,11 @@ Job::set_state (State s)
        boost::mutex::scoped_lock lm (_state_mutex);
        _state = s;
 
-       if (_state == FINISHED_OK || _state == FINISHED_ERROR) {
+       if (_state == FINISHED_OK || _state == FINISHED_ERROR || _state == FINISHED_CANCELLED) {
                _ran_for = elapsed_time ();
+               if (ui_signaller) {
+                       ui_signaller->emit (boost::bind (boost::ref (Finished)));
+               }
        }
 }