projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo in log message.
[dcpomatic.git]
/
src
/
lib
/
send_notification_email_job.cc
diff --git
a/src/lib/send_notification_email_job.cc
b/src/lib/send_notification_email_job.cc
index 6d7882e71974a5ec15a3df06d7b10ca0f3a8c93c..c4d5a65183ca93484e9b225628e46a59d836f3a1 100644
(file)
--- a/
src/lib/send_notification_email_job.cc
+++ b/
src/lib/send_notification_email_job.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2021
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,19
+18,21
@@
*/
*/
+
#include "send_notification_email_job.h"
#include "exceptions.h"
#include "config.h"
#include "emailer.h"
#include "compose.hpp"
#include "send_notification_email_job.h"
#include "exceptions.h"
#include "config.h"
#include "emailer.h"
#include "compose.hpp"
-#include <boost/foreach.hpp>
#include <list>
#include "i18n.h"
#include <list>
#include "i18n.h"
+
using std::string;
using std::list;
using std::string;
using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
+
/** @param body Email body */
SendNotificationEmailJob::SendNotificationEmailJob (string body)
/** @param body Email body */
SendNotificationEmailJob::SendNotificationEmailJob (string body)
@@
-40,22
+42,31
@@
SendNotificationEmailJob::SendNotificationEmailJob (string body)
}
}
+
+SendNotificationEmailJob::~SendNotificationEmailJob ()
+{
+ stop_thread ();
+}
+
+
string
SendNotificationEmailJob::name () const
{
return _("Email notification");
}
string
SendNotificationEmailJob::name () const
{
return _("Email notification");
}
+
string
SendNotificationEmailJob::json_name () const
{
return N_("send_notification_email");
}
string
SendNotificationEmailJob::json_name () const
{
return N_("send_notification_email");
}
+
void
SendNotificationEmailJob::run ()
{
void
SendNotificationEmailJob::run ()
{
-
Config*
config = Config::instance ();
+
auto
config = Config::instance ();
if (config->mail_server().empty()) {
throw NetworkError (_("No mail server configured in preferences"));
if (config->mail_server().empty()) {
throw NetworkError (_("No mail server configured in preferences"));
@@
-63,16
+74,16
@@
SendNotificationEmailJob::run ()
set_progress_unknown ();
list<string> to;
set_progress_unknown ();
list<string> to;
- to.push_back (config->notification_to
());
+ to.push_back (config->notification_to());
Emailer email (config->notification_from(), to, config->notification_subject(), _body);
Emailer email (config->notification_from(), to, config->notification_subject(), _body);
-
BOOST_FOREACH (string i,
config->notification_cc()) {
+
for (auto i:
config->notification_cc()) {
email.add_cc (i);
}
if (!config->notification_bcc().empty()) {
email.add_cc (i);
}
if (!config->notification_bcc().empty()) {
- email.add_bcc (config->notification_bcc
());
+ email.add_bcc (config->notification_bcc());
}
}
- email.send (config->mail_server(), config->mail_port(), config->mail_user(), config->mail_password());
+ email.send (config->mail_server(), config->mail_port(), config->mail_
protocol(), config->mail_
user(), config->mail_password());
set_progress (1);
set_state (FINISHED_OK);
set_progress (1);
set_state (FINISHED_OK);