Comment.
[dcpomatic.git] / src / lib / send_kdm_email_job.cc
index 43c399c255510ae456cf312bc2f9b39e28777383..4d17123f1f2897a01701743216f772271a5822a9 100644 (file)
@@ -29,12 +29,14 @@ using std::string;
 using std::list;
 using boost::shared_ptr;
 
+/** @param log Log to write to, or 0 */
 SendKDMEmailJob::SendKDMEmailJob (
        string film_name,
        string cpl_name,
        boost::posix_time::ptime from,
        boost::posix_time::ptime to,
-       list<CinemaKDMs> cinema_kdms
+       list<CinemaKDMs> cinema_kdms,
+       shared_ptr<Log> log
        )
        : Job (shared_ptr<Film>())
        , _film_name (film_name)
@@ -42,6 +44,7 @@ SendKDMEmailJob::SendKDMEmailJob (
        , _from (from)
        , _to (to)
        , _cinema_kdms (cinema_kdms)
+       , _log (log)
 {
 
 }
@@ -49,6 +52,10 @@ SendKDMEmailJob::SendKDMEmailJob (
 string
 SendKDMEmailJob::name () const
 {
+       if (_film_name.empty ()) {
+               return _("Email KDMs");
+       }
+
        return String::compose (_("Email KDMs for %1"), _film_name);
 }
 
@@ -62,7 +69,7 @@ void
 SendKDMEmailJob::run ()
 {
        set_progress_unknown ();
-       CinemaKDMs::email (_film_name, _cpl_name, _cinema_kdms, _from, _to);
+       CinemaKDMs::email (_film_name, _cpl_name, _cinema_kdms, _from, _to, _log);
        set_progress (1);
        set_state (FINISHED_OK);
 }