Commit 6ddb6d7a authored by Laurent Montel's avatar Laurent Montel 😁

continue to extract code

parent 8d88c9ec
......@@ -22,6 +22,8 @@
#include "composer/keyresolver.h"
#include <KLocalizedString>
using namespace MessageComposer;
namespace
......@@ -103,7 +105,9 @@ inline bool showKeyApprovalDialog()
GenerateCryptoMessagesJob::GenerateCryptoMessagesJob(QObject *parent)
: QObject(parent)
: QObject(parent),
mSign(false),
mEncrypt(false)
{
}
......@@ -113,9 +117,33 @@ GenerateCryptoMessagesJob::~GenerateCryptoMessagesJob()
}
#if 0
QList< MessageComposer::Composer * > ComposerViewBase::generateCryptoMessages(bool &wasCanceled)
void GenerateCryptoMessagesJob::setIdentity(const KIdentityManagement::Identity &id)
{
mId = id;
}
void GenerateCryptoMessagesJob::setAttachmentList(const MessageCore::AttachmentPart::List &attachmentList)
{
mAttachmentList = attachmentList;
}
void GenerateCryptoMessagesJob::setSign(bool sign)
{
mSign = sign;
}
void GenerateCryptoMessagesJob::setEncrypt(bool encrypt)
{
mEncrypt = encrypt;
}
QList<MessageComposer::Composer *> GenerateCryptoMessagesJob::generateCryptoMessages(bool &wasCanceled)
{
if (mId.isNull()) {
//Signal it.
return {};
}
#if 0
const KIdentityManagement::Identity &id = m_identMan->identityForUoidOrDefault(m_identityCombo->currentIdentity());
qCDebug(MESSAGECOMPOSER_LOG) << "filling crypto info";
......@@ -285,5 +313,7 @@ QList< MessageComposer::Composer * > ComposerViewBase::generateCryptoMessages(bo
}
return composers;
}
#else
return {};
#endif
}
......@@ -20,6 +20,9 @@
#define GENERATECRYPTOMESSAGESJOB_H
#include <QObject>
#include <KIdentityManagement/Identity>
#include <MessageCore/AttachmentPart>
#include <MessageComposer/Composer>
namespace MessageComposer
{
......@@ -30,8 +33,23 @@ public:
explicit GenerateCryptoMessagesJob(QObject *parent = nullptr);
~GenerateCryptoMessagesJob();
QList<MessageComposer::Composer *> generateCryptoMessages(bool &wasCanceled);
void setIdentity(const KIdentityManagement::Identity &id);
void setAttachmentList(const MessageCore::AttachmentPart::List &attachmentList);
void setSign(bool sign);
void setEncrypt(bool encrypt);
Q_SIGNALS:
void failed(const QString &msg);
private:
KIdentityManagement::Identity mId;
MessageCore::AttachmentPart::List mAttachmentList;
bool mSign;
bool mEncrypt;
};
}
......
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