diff --git a/messagecomposer/src/helper/messagefactoryforwardjob.cpp b/messagecomposer/src/helper/messagefactoryforwardjob.cpp index 85c7f033..b4978766 100644 --- a/messagecomposer/src/helper/messagefactoryforwardjob.cpp +++ b/messagecomposer/src/helper/messagefactoryforwardjob.cpp @@ -1,87 +1,84 @@ /* Copyright (C) 2017-2019 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "messagefactoryforwardjob.h" #include "settings/messagecomposersettings.h" #include #include using namespace MessageComposer; MessageFactoryForwardJob::MessageFactoryForwardJob(QObject *parent) : QObject(parent) - , mMsg(nullptr) - , mOrigMsg(nullptr) - , mIdentityManager(nullptr) { } MessageFactoryForwardJob::~MessageFactoryForwardJob() { } void MessageFactoryForwardJob::start() { TemplateParser::TemplateParserJob *parser = new TemplateParser::TemplateParserJob(mMsg, TemplateParser::TemplateParserJob::Forward, this); connect(parser, &TemplateParser::TemplateParserJob::parsingDone, this, &MessageFactoryForwardJob::slotParsingDone); parser->setIdentityManager(mIdentityManager); parser->setCharsets(MessageComposerSettings::self()->preferredCharsets()); parser->setSelection(mSelection); if (!mTemplate.isEmpty()) { parser->process(mTemplate, mOrigMsg); } else { parser->process(mOrigMsg, mCollection.id()); } } void MessageFactoryForwardJob::slotParsingDone() { Q_EMIT forwardDone(mMsg); deleteLater(); } void MessageFactoryForwardJob::setCollection(const Akonadi::Collection &collection) { mCollection = collection; } void MessageFactoryForwardJob::setMsg(const KMime::Message::Ptr &msg) { mMsg = msg; } void MessageFactoryForwardJob::setTemplate(const QString &tmpl) { mTemplate = tmpl; } void MessageFactoryForwardJob::setSelection(const QString &selection) { mSelection = selection; } void MessageFactoryForwardJob::setOrigMsg(const KMime::Message::Ptr &origMsg) { mOrigMsg = origMsg; } void MessageFactoryForwardJob::setIdentityManager(KIdentityManagement::IdentityManager *identityManager) { mIdentityManager = identityManager; } diff --git a/messagecomposer/src/helper/messagefactoryforwardjob.h b/messagecomposer/src/helper/messagefactoryforwardjob.h index 58cfa128..ac0ed9cf 100644 --- a/messagecomposer/src/helper/messagefactoryforwardjob.h +++ b/messagecomposer/src/helper/messagefactoryforwardjob.h @@ -1,65 +1,65 @@ /* Copyright (C) 2017-2019 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MESSAGEFACTORYFORWARDJOB_H #define MESSAGEFACTORYFORWARDJOB_H #include #include #include namespace KIdentityManagement { class IdentityManager; } namespace MessageComposer { class MessageFactoryForwardJob : public QObject { Q_OBJECT public: explicit MessageFactoryForwardJob(QObject *parent = nullptr); ~MessageFactoryForwardJob(); void start(); void setMsg(const KMime::Message::Ptr &msg); void setTemplate(const QString &tmpl); void setSelection(const QString &selection); void setOrigMsg(const KMime::Message::Ptr &origMsg); void setIdentityManager(KIdentityManagement::IdentityManager *identityManager); void setCollection(const Akonadi::Collection &collection); Q_SIGNALS: void forwardDone(const KMime::Message::Ptr &msg); private: void slotParsingDone(); QString mSelection; QString mTemplate; - KMime::Message::Ptr mMsg; - KMime::Message::Ptr mOrigMsg; + KMime::Message::Ptr mMsg = nullptr; + KMime::Message::Ptr mOrigMsg = nullptr; Akonadi::Collection mCollection; KIdentityManagement::IdentityManager *mIdentityManager = nullptr; }; } #endif // MESSAGEFACTORYFORWARDJOB_H