summaryrefslogtreecommitdiff
path: root/src/lib/upload_job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-07-04 00:13:39 +0200
committerCarl Hetherington <cth@carlh.net>2021-07-04 00:13:39 +0200
commit34e5ddc254c0a12224cb985e440a2ab7075b532a (patch)
tree5b83d940eb4c41ec405a98241fc26bb0fffbba3a /src/lib/upload_job.cc
parentfa4da415f1788bed17eefd05ba8d49b8ad847613 (diff)
C++11 tidying.
Diffstat (limited to 'src/lib/upload_job.cc')
-rw-r--r--src/lib/upload_job.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/lib/upload_job.cc b/src/lib/upload_job.cc
index ec474abdf..113e3a7e8 100644
--- a/src/lib/upload_job.cc
+++ b/src/lib/upload_job.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,22 +18,25 @@
*/
+
/** @file src/upload_job.cc
* @brief A job to copy DCPs to a server using libcurl.
*/
+
#include "compose.hpp"
-#include "upload_job.h"
#include "config.h"
-#include "log.h"
+#include "curl_uploader.h"
#include "dcpomatic_log.h"
#include "film.h"
+#include "log.h"
#include "scp_uploader.h"
-#include "curl_uploader.h"
+#include "upload_job.h"
#include <iostream>
#include "i18n.h"
+
using std::string;
using std::min;
using std::shared_ptr;
@@ -42,6 +45,7 @@ using boost::scoped_ptr;
using namespace boost::placeholders;
#endif
+
UploadJob::UploadJob (shared_ptr<const Film> film)
: Job (film)
, _status (_("Waiting"))
@@ -49,23 +53,27 @@ UploadJob::UploadJob (shared_ptr<const Film> film)
}
+
UploadJob::~UploadJob ()
{
stop_thread ();
}
+
string
UploadJob::name () const
{
return _("Copy DCP to TMS");
}
+
string
UploadJob::json_name () const
{
return N_("upload");
}
+
void
UploadJob::run ()
{
@@ -88,17 +96,19 @@ UploadJob::run ()
set_state (FINISHED_OK);
}
+
string
UploadJob::status () const
{
boost::mutex::scoped_lock lm (_status_mutex);
- string s = Job::status ();
- if (!_status.empty () && !finished_in_error ()) {
+ auto s = Job::status ();
+ if (!_status.empty() && !finished_in_error()) {
s += N_("; ") + _status;
}
return s;
}
+
void
UploadJob::set_status (string s)
{