Commit e15b6524 authored by Laurent Montel's avatar Laurent Montel 😁

Activate sendmailjob

parent 7188e7e1
set(mailtransport_sendplugin_SRCS
sendmailtransportplugin.cpp
sendmailjob.cpp
)
kcoreaddons_add_plugin(mailtransport_sendplugin JSON sendmailtransport.json SOURCES
${mailtransport_sendplugin_SRCS} INSTALL_NAMESPACE mailtransport)
target_link_libraries(mailtransport_sendplugin
KF5::MailTransport KF5::CoreAddons KF5::I18n
KF5::MailTransport KF5::CoreAddons KF5::I18n KF5::ConfigWidgets
)
......@@ -26,8 +26,8 @@
#include <KLocalizedString>
#include <QtCore/QProcess>
#include <QtCore/QBuffer>
#include <QProcess>
#include <QBuffer>
using namespace MailTransport;
......@@ -38,7 +38,7 @@ using namespace MailTransport;
class SendMailJobPrivate
{
public:
QProcess *process;
QProcess *process = nullptr;
QString lastError;
};
......@@ -63,9 +63,7 @@ SendmailJob::~SendmailJob()
void SendmailJob::doStart()
{
QStringList arguments;
arguments << QLatin1String("-i") << QLatin1String("-f")
<< sender() << to() << cc() << bcc();
const QStringList arguments = QStringList() << QLatin1String("-i") << QLatin1String("-f") << sender() << to() << cc() << bcc();
d->process->start(transport()->host(), arguments);
if (!d->process->waitForStarted()) {
......@@ -104,6 +102,6 @@ void SendmailJob::receivedStdErr()
bool SendmailJob::doKill()
{
delete d->process;
d->process = 0;
d->process = nullptr;
return true;
}
......@@ -45,7 +45,7 @@ public:
@param transport The transport settings.
@param parent The parent object.
*/
explicit SendmailJob(Transport *transport, QObject *parent = 0);
explicit SendmailJob(Transport *transport, QObject *parent = nullptr);
/**
Destroys this job.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment