Commit 883b9686 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent 691abd6b
......@@ -14,9 +14,9 @@
#include <kmime/kmime_headers.h>
using namespace KMime;
#include <MessageComposer/AttachmentJob>
#include <MessageComposer/Composer>
#include <MessageComposer/GlobalPart>
#include <MessageComposer/AttachmentJob>
using namespace MessageComposer;
//#include "messagecore/attachmentfromfolderjob.h"
......@@ -58,7 +58,7 @@ void AttachmentJobTest::testAttachment()
QVERIFY(result->contentDisposition(false)->disposition() == Headers::CDattachment);
delete ajob;
ajob = nullptr;
//delete result;
// delete result;
}
#if 0
......
......@@ -14,8 +14,8 @@ class AttachmentJobTest : public QObject
Q_OBJECT
private Q_SLOTS:
void testAttachment();
//void testTextCharsetAutodetect_data();
//void testTextCharsetAutodetect();
// void testTextCharsetAutodetect_data();
// void testTextCharsetAutodetect();
};
#endif
......@@ -7,8 +7,8 @@
#include "attachmentvcardfromaddressbookjobtest.h"
#include "MessageComposer/AttachmentVcardFromAddressBookJob"
#include <QTest>
#include <KContacts/Addressee>
#include <QTest>
AttachmentVcardFromAddressBookJobTest::AttachmentVcardFromAddressBookJobTest(QObject *parent)
: QObject(parent)
......
......@@ -10,7 +10,8 @@
#include <QObject>
namespace MessageComposer {
namespace MessageComposer
{
class Composer;
}
......
......@@ -5,8 +5,8 @@
*/
#include "composerviewbasetest.h"
#include <QTest>
#include "../src/composer/composerviewbase.h"
#include <QTest>
ComposerViewBaseTest::ComposerViewBaseTest(QObject *parent)
: QObject(parent)
......@@ -30,7 +30,7 @@ void ComposerViewBaseTest::shouldHaveDefaultValue()
QVERIFY(!composerViewBase.transportComboBox());
QVERIFY(!composerViewBase.fccCombo());
QVERIFY(!composerViewBase.dictionary());
#if 0 //mrecipient is null
#if 0 // mrecipient is null
QVERIFY(composerViewBase.to().isEmpty());
QVERIFY(composerViewBase.cc().isEmpty());
QVERIFY(composerViewBase.bcc().isEmpty());
......
......@@ -7,8 +7,8 @@
#include "cryptocomposertest.h"
#include "qtest_messagecomposer.h"
#include "cryptofunctions.h"
#include "qtest_messagecomposer.h"
#include "setupenv.h"
......@@ -17,15 +17,15 @@
#include <KMime/Headers>
using namespace KMime;
#include <MessageComposer/AttachmentControllerBase>
#include <MessageComposer/AttachmentModel>
#include <MessageComposer/Composer>
#include <MessageComposer/ComposerViewBase>
#include <MessageComposer/RichTextComposerNg>
#include <MessageComposer/GlobalPart>
#include <MessageComposer/InfoPart>
#include <MessageComposer/RichTextComposerNg>
#include <MessageComposer/TextPart>
#include <MessageComposer/Util>
#include <MessageComposer/AttachmentControllerBase>
#include <MessageComposer/AttachmentModel>
using namespace MessageComposer;
#include <MessageCore/AttachmentPart>
......@@ -87,9 +87,8 @@ void CryptoComposerTest::testOpenPGPMime()
delete composer;
composer = nullptr;
//qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verify(sign, encrypt, message.data(), data.toUtf8(),
Kleo::OpenPGPMIMEFormat, cte);
// qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verify(sign, encrypt, message.data(), data.toUtf8(), Kleo::OpenPGPMIMEFormat, cte);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -101,8 +100,8 @@ void CryptoComposerTest::testEncryptSameAttachments_data()
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: fix Inline PGP with encrypted attachments
//QTest::newRow( "InlineOpenPGP" ) << (int) Kleo::InlineOpenPGPFormat;
// TODO: fix Inline PGP with encrypted attachments
// QTest::newRow( "InlineOpenPGP" ) << (int) Kleo::InlineOpenPGPFormat;
}
void CryptoComposerTest::testEncryptSameAttachments()
......@@ -131,9 +130,8 @@ void CryptoComposerTest::testEncryptSameAttachments()
delete composer;
composer = nullptr;
//qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verifyEncryption(message.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat)format, true);
// qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verifyEncryption(message.data(), data.toUtf8(), (Kleo::CryptoMessageFormat)format, true);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -156,7 +154,7 @@ void CryptoComposerTest::testEditEncryptAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: SMIME should also be tested
// TODO: SMIME should also be tested
}
void CryptoComposerTest::testEditEncryptAttachments()
......@@ -212,7 +210,7 @@ void CryptoComposerTest::testEditEncryptAndLateAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: SMIME should also be tested
// TODO: SMIME should also be tested
}
void CryptoComposerTest::testEditEncryptAndLateAttachments()
......@@ -265,7 +263,7 @@ void CryptoComposerTest::testEditEncryptAndLateAttachments()
// Let's load the email to the viewer
view.setMessage(message, true);
//QModelIndex index = model.index(0, 0);
// QModelIndex index = model.index(0, 0);
QCOMPARE(editor.toPlainText(), data);
QCOMPARE(model.rowCount(), 2);
AttachmentPart::Ptr part = model.attachments()[0];
......@@ -312,8 +310,7 @@ void CryptoComposerTest::testSignEncryptLateAttachments()
// as we have an additional attachment, just ignore it when checking for sign/encrypt
KMime::Content *b = MessageCore::NodeHelper::firstChild(message.data());
ComposerTestUtil::verifySignatureAndEncryption(b, data.toUtf8(),
(Kleo::CryptoMessageFormat)format, true);
ComposerTestUtil::verifySignatureAndEncryption(b, data.toUtf8(), (Kleo::CryptoMessageFormat)format, true);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -379,7 +376,7 @@ void CryptoComposerTest::testProtectedHeaders()
} else if (encrypt) {
auto extraContents = nh.extraContents(message.data());
QCOMPARE(extraContents.size(), 1);
part = extraContents.first();
part = extraContents.first();
if (sign) {
QVERIFY(!part->contentType(false)->hasParameter(QStringLiteral("protected-headers")));
QVERIFY(!part->headerByType("to"));
......@@ -388,7 +385,7 @@ void CryptoComposerTest::testProtectedHeaders()
}
}
QVERIFY(part);
QCOMPARE(part->contentType(false)->parameter(QStringLiteral("protected-headers")),QStringLiteral("v1"));
QCOMPARE(part->contentType(false)->parameter(QStringLiteral("protected-headers")), QStringLiteral("v1"));
QCOMPARE(part->headerByType("to")->asUnicodeString(), QStringLiteral("you@you.you"));
QCOMPARE(part->headerByType("from")->asUnicodeString(), QStringLiteral("me@me.me"));
}
......@@ -415,17 +412,17 @@ void CryptoComposerTest::testBCCEncrypt()
QStringList primRecipients;
primRecipients << QString::fromLocal8Bit("you@you.you");
std::vector< GpgME::Key > pkeys;
std::vector<GpgME::Key> pkeys;
pkeys.push_back(keys[1]);
QStringList secondRecipients;
secondRecipients << QString::fromLocal8Bit("bcc@bcc.org");
std::vector< GpgME::Key > skeys;
std::vector<GpgME::Key> skeys;
skeys.push_back(keys[2]);
QVector<QPair<QStringList, std::vector<GpgME::Key> > > encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key> >(primRecipients, pkeys));
encKeys.append(QPair<QStringList, std::vector<GpgME::Key> >(secondRecipients, skeys));
QVector<QPair<QStringList, std::vector<GpgME::Key>>> encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key>>(primRecipients, pkeys));
encKeys.append(QPair<QStringList, std::vector<GpgME::Key>>(secondRecipients, skeys));
composer->setSignAndEncrypt(true, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
......@@ -441,14 +438,12 @@ void CryptoComposerTest::testBCCEncrypt()
delete composer;
composer = nullptr;
ComposerTestUtil::verifySignatureAndEncryption(primMessage.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat)format);
ComposerTestUtil::verifySignatureAndEncryption(primMessage.data(), data.toUtf8(), (Kleo::CryptoMessageFormat)format);
QCOMPARE(primMessage->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(primMessage->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
ComposerTestUtil::verifySignatureAndEncryption(secMessage.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat)format);
ComposerTestUtil::verifySignatureAndEncryption(secMessage.data(), data.toUtf8(), (Kleo::CryptoMessageFormat)format);
QCOMPARE(secMessage->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(secMessage->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -493,9 +488,8 @@ void CryptoComposerTest::testOpenPGPInline()
if (sign && !encrypt) {
data += QLatin1Char('\n');
}
//qDebug() << "message:" << message->encodedContent();
ComposerTestUtil::verify(sign, encrypt, message.data(), data.toUtf8(),
Kleo::InlineOpenPGPFormat, cte);
// qDebug() << "message:" << message->encodedContent();
ComposerTestUtil::verify(sign, encrypt, message.data(), data.toUtf8(), Kleo::InlineOpenPGPFormat, cte);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -560,7 +554,8 @@ void CryptoComposerTest::testCTEquPr_data()
QTest::newRow("CTEquPr:SignEncrypt") << data << true << true << Headers::CE7Bit;
data = QStringLiteral(
"All happy families are alike;\n\n\n\neach unhappy family is unhappy in its own way.\n--\n hallloasdfasdfsadfsdf asdf sadfasdf sdf sdf sdf sadfasdf sdaf daf sdf asdf sadf asdf asdf [ä]");
"All happy families are alike;\n\n\n\neach unhappy family is unhappy in its own way.\n--\n hallloasdfasdfsadfsdf asdf sadfasdf sdf sdf sdf sadfasdf "
"sdaf daf sdf asdf sadf asdf asdf [ä]");
QTest::newRow("CTEquPr:Sign:Newline") << data << true << false << Headers::CEquPr;
QTest::newRow("CTEquPr:Encrypt:Newline") << data << false << true << Headers::CE7Bit;
QTest::newRow("CTEquPr:SignEncrypt:Newline") << data << true << true << Headers::CE7Bit;
......@@ -581,8 +576,10 @@ void CryptoComposerTest::testCTEbase64_data()
QTest::addColumn<bool>("encrypt");
QTest::addColumn<Headers::contentEncoding>("cte");
QString data(QStringLiteral(
"[ääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääää]"));
QString data(
QStringLiteral("[ääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääää"
"äääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääää"
"äääääääääääääääääääääääääääääääääääääääääääääää]"));
QTest::newRow("CTEbase64:Sign") << data << true << false << Headers::CEbase64;
QTest::newRow("CTEbase64:Encrypt") << data << false << true << Headers::CE7Bit;
QTest::newRow("CTEbase64:SignEncrypt") << data << true << true << Headers::CE7Bit;
......@@ -609,13 +606,13 @@ void CryptoComposerTest::fillComposerCryptoData(Composer *composer)
{
std::vector<GpgME::Key> keys = MessageComposer::Test::getKeys();
//qDebug() << "got num of keys:" << keys.size();
// qDebug() << "got num of keys:" << keys.size();
QStringList recipients;
recipients << QString::fromLocal8Bit("you@you.you");
QVector<QPair<QStringList, std::vector<GpgME::Key> > > encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key> >(recipients, keys));
QVector<QPair<QStringList, std::vector<GpgME::Key>>> encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key>>(recipients, keys));
composer->setEncryptionKeys(encKeys);
composer->setSigningKeys(keys);
......@@ -634,8 +631,8 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
std::vector<GpgME::Key> keys = MessageComposer::Test::getKeys(true);
QStringList recipients;
recipients << QString::fromLocal8Bit("you@you.you");
QVector<QPair<QStringList, std::vector<GpgME::Key> > > encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key> >(recipients, keys));
QVector<QPair<QStringList, std::vector<GpgME::Key>>> encKeys;
encKeys.append(QPair<QStringList, std::vector<GpgME::Key>>(recipients, keys));
composer->setEncryptionKeys(encKeys);
composer->setSigningKeys(keys);
composer->setSignAndEncrypt(sign, enc);
......@@ -648,7 +645,7 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
composer->setMessageCryptoFormat(f);
const bool result = composer->exec();
//QEXPECT_FAIL("", "GPG setup problems", Continue);
// QEXPECT_FAIL("", "GPG setup problems", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(composer->resultMessages().size(), 1);
......@@ -656,7 +653,7 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
delete composer;
composer = nullptr;
//qDebug() << "message:" << message->encodedContent();
// qDebug() << "message:" << message->encodedContent();
ComposerTestUtil::verify(sign, enc, message.data(), data.toUtf8(), f, cte);
......
......@@ -10,7 +10,8 @@
#include <QObject>
namespace MessageComposer {
namespace MessageComposer
{
class Composer;
}
......
......@@ -11,8 +11,8 @@
#include <MessageComposer/Util>
#include <KMime/Message>
#include <KMime/Content>
#include <KMime/Message>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/SimpleObjectTreeSource>
......@@ -20,12 +20,17 @@
#include <MessageCore/NodeHelper>
#include <QTest>
#include <stdlib.h>
#include <gpgme++/keylistresult.h>
#include <stdlib.h>
using namespace MessageComposer;
void ComposerTestUtil::verify(bool sign, bool encrypt, KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding)
void ComposerTestUtil::verify(bool sign,
bool encrypt,
KMime::Content *content,
const QByteArray &origContent,
Kleo::CryptoMessageFormat f,
KMime::Headers::contentEncoding encoding)
{
if (sign && encrypt) {
verifySignatureAndEncryption(content, origContent, f, false);
......@@ -36,7 +41,10 @@ void ComposerTestUtil::verify(bool sign, bool encrypt, KMime::Content *content,
}
}
void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray &signedContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding)
void ComposerTestUtil::verifySignature(KMime::Content *content,
const QByteArray &signedContent,
Kleo::CryptoMessageFormat f,
KMime::Headers::contentEncoding encoding)
{
// store it in a KMime::Message, that's what OTP needs
auto resultMessage = new KMime::Message;
......@@ -58,7 +66,7 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
QCOMPARE(signedPart->contentTransferEncoding()->encoding(), KMime::Headers::CE7Bit);
Q_UNUSED(signedPart)
//Q_ASSERT( nh->signatureState( resultMessage ) == MimeTreeParser::KMMsgFullySigned );
// Q_ASSERT( nh->signatureState( resultMessage ) == MimeTreeParser::KMMsgFullySigned );
QCOMPARE(MessageCore::NodeHelper::firstChild(resultMessage)->contentTransferEncoding()->encoding(), encoding);
} else if (f & Kleo::InlineOpenPGPFormat) {
......@@ -97,7 +105,7 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
// process the result..
otp.parseObjectTree(resultMessage);
//Q_ASSERT( nh->signatureState( resultMessage ) == MimeTreeParser::KMMsgFullySigned );
// Q_ASSERT( nh->signatureState( resultMessage ) == MimeTreeParser::KMMsgFullySigned );
}
// make sure the good sig is of what we think it is
......@@ -129,7 +137,7 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
QCOMPARE(nh->encryptionState(resultMessage.data()), MimeTreeParser::KMMsgFullyEncrypted);
} else if (f & Kleo::InlineOpenPGPFormat) {
if (withAttachment) {
//Only first MimePart is the encrypted Text
// Only first MimePart is the encrypted Text
KMime::Content *cContent = MessageCore::NodeHelper::firstChild(resultMessage.data());
resultMessage->setContent(cContent->encodedContent());
resultMessage->parse();
......@@ -157,7 +165,11 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
Q_UNUSED(encrContent)
}
void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment, bool combind)
void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content,
const QByteArray &origContent,
Kleo::CryptoMessageFormat f,
bool withAttachment,
bool combind)
{
Q_UNUSED(withAttachment)
// store it in a KMime::Message, that's what OTP needs
......@@ -179,14 +191,14 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
otp.parseObjectTree(resultMessage.data());
QCOMPARE(nh->encryptionState(resultMessage.data()), MimeTreeParser::KMMsgFullyEncrypted);
QVector< KMime::Content * > extra = nh->extraContents(resultMessage.data());
QVector<KMime::Content *> extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
if (combind) {
QCOMPARE(nh->signatureState(resultMessage.data()), MimeTreeParser::KMMsgFullySigned);
} else {
QVector< KMime::Content * > extra = nh->extraContents(resultMessage.data());
QVector<KMime::Content *> extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
QCOMPARE(nh->signatureState(extra[ 0 ]), MimeTreeParser::KMMsgFullySigned);
QCOMPARE(nh->signatureState(extra[0]), MimeTreeParser::KMMsgFullySigned);
}
} else if (f & Kleo::InlineOpenPGPFormat) {
otp.parseObjectTree(resultMessage.data());
......@@ -206,9 +218,9 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
otp.parseObjectTree(resultMessage.data());
QCOMPARE(nh->encryptionState(resultMessage.data()), MimeTreeParser::KMMsgFullyEncrypted);
QVector< KMime::Content * > extra = nh->extraContents(resultMessage.data());
QVector<KMime::Content *> extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
QCOMPARE(nh->signatureState(extra[ 0 ]), MimeTreeParser::KMMsgFullySigned);
QCOMPARE(nh->signatureState(extra[0]), MimeTreeParser::KMMsgFullySigned);
}
QCOMPARE(otp.plainTextContent().trimmed(), QString::fromUtf8(origContent).trimmed());
Q_UNUSED(origContent)
......
......@@ -9,19 +9,26 @@
#define CRYPTO_FUNCTIONS_H
#include <Libkleo/Enum>
#include <kmime/kmime_headers.h>
#include <QByteArray>
#include <kmime/kmime_headers.h>
namespace KMime {
namespace KMime
{
class Content;
}
namespace ComposerTestUtil {
namespace ComposerTestUtil
{
/**
* gate function to run verifySignature, verifyEncryption or verifySignatureAndEncryption.
*/
void verify(bool sign, bool encrypt, KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding);
void verify(bool sign,
bool encrypt,
KMime::Content *content,
const QByteArray &origContent,
Kleo::CryptoMessageFormat f,
KMime::Headers::contentEncoding encoding);
/**
* Verifies that the given MIME content is signed and that the text is equal
......@@ -36,7 +43,11 @@ void verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kl
/**
* Verifies that the given MIME content is signed and then encrypted, and the original text is as specified
*/
void verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment = false, bool combind = false);
void verifySignatureAndEncryption(KMime::Content *content,
const QByteArray &origContent,
Kleo::CryptoMessageFormat f,
bool withAttachment = false,
bool combind = false);
}
#endif
......@@ -7,8 +7,8 @@
#include "encryptjobtest.h"
#include "qtest_messagecomposer.h"
#include "cryptofunctions.h"
#include "qtest_messagecomposer.h"
#include "setupenv.h"
#include <KMime/Content>
......@@ -23,17 +23,17 @@
#include <MessageComposer/TransparentJob>
#include <MessageComposer/Util>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
#include <QGpgME/Protocol>
#include <QGpgME/DecryptVerifyJob>
#include <QGpgME/Protocol>
#include <gpgme++/verificationresult.h>
#include <gpgme++/decryptionresult.h>
#include <gpgme++/verificationresult.h>
#include <stdlib.h>
#include <KCharsets>
#include <stdlib.h>
#include <QTest>
#include <decryptionresult.h>
......@@ -63,7 +63,7 @@ void EncryptJobTest::testContentDirect()
VERIFYEXEC(mainTextJob);
const std::vector< GpgME::Key > &keys = Test::getKeys();
const std::vector<GpgME::Key> &keys = Test::getKeys();
auto eJob = new EncryptJob(&composer);
......@@ -95,7 +95,7 @@ void EncryptJobTest::testContentChained()
VERIFYEXEC(mainTextJob);
const std::vector< GpgME::Key > &keys = Test::getKeys();
const std::vector<GpgME::Key> &keys = Test::getKeys();
auto eJob = new EncryptJob(&composer);
const QStringList recipients = {QStringLiteral("test@kolab.org")};
......@@ -110,7 +110,7 @@ void EncryptJobTest::testContentChained()
void EncryptJobTest::testContentSubjobChained()
{
const std::vector< GpgME::Key > &keys = Test::getKeys();
const std::vector<GpgME::Key> &keys = Test::getKeys();
const QByteArray data(QStringLiteral("one flew over the cuckoo's nest").toUtf8());
KMime::Message skeletonMessage;
......@@ -138,7 +138,7 @@ void EncryptJobTest::testContentSubjobChained()
void EncryptJobTest::testHeaders()
{
const std::vector< GpgME::Key > &keys = Test::getKeys();
const std::vector<GpgME::Key> &keys = Test::getKeys();
auto eJob = new EncryptJob(this);
......@@ -189,7 +189,7 @@ void EncryptJobTest::testProtectedHeaders()
QFETCH(bool, protectedHeadersObvoscate);
QFETCH(QString, referenceFile);
const std::vector< GpgME::Key > &keys = Test::getKeys();
const std::vector<GpgME::Key> &keys = Test::getKeys();
Composer composer;
auto eJob = new EncryptJob(&composer);
......@@ -257,7 +257,7 @@ void EncryptJobTest::testProtectedHeaders()
}
f.close();
Test::compareFile(referenceFile, QStringLiteral(MAIL_DATA_DIR "/")+referenceFile);
Test::compareFile(referenceFile, QStringLiteral(MAIL_DATA_DIR "/") + referenceFile);
}
void EncryptJobTest::checkEncryption(EncryptJob *eJob)
......
......@@ -10,7 +10,8 @@
#include <QObject>
namespace MessageComposer {
namespace MessageComposer
{
class EncryptJob;
}
......
......@@ -6,16 +6,16 @@
#include "followupreminderselectdatedialogtest.h"
#include "../src/followupreminder/followupreminderselectdatedialog.h"
#include <QTest>
#include <QLineEdit>
#include <KDateComboBox>
#include <AkonadiWidgets/CollectionComboBox>
#include <KDateComboBox>
#include <QLineEdit>
#include <QTest>
#include <AkonadiCore/EntityTreeModel>
#include <KCalendarCore/Todo>
#include <QLineEdit>
#include <QPushButton>
#include <AkonadiCore/EntityTreeModel>
#include <QStandardItemModel>
#include <KCalendarCore/Todo>
FollowupReminderSelectDateDialogTest::FollowupReminderSelectDateDialogTest(QObject *parent)
: QObject(parent)
......@@ -36,10 +36,8 @@ QStandardItemModel *FollowupReminderSelectDateDialogTest::defaultItemModel()
collection.setContentMimeTypes(QStringList() << KCalendarCore::Todo::todoMimeType());
QStandardItem *item = new QStandardItem(collection.name());
item->setData(QVariant::fromValue(collection),
Akonadi::EntityTreeModel::CollectionRole);
item->setData(QVariant::fromValue(collection.id()),
Akonadi::EntityTreeModel::CollectionIdRole);
item->setData(QVariant::fromValue(collection), Akonadi::EntityTreeModel::CollectionRole);
item->setData(QVariant::fromValue(collection.id()), Akonadi::EntityTreeModel::CollectionIdRole);
model->appendRow(item);