Commit bd848634 authored by Sandro Knauß's avatar Sandro Knauß
Browse files

fixup(messagecomposer): use const argument for setSigningKeys.

Summary: signingKeys are just an input and won't modified by the job itself.

Test Plan: run autotests.

Reviewers: #kde_pim

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28826
parent 95e56a7f
......@@ -53,7 +53,7 @@ void SignAndEncryptTest::initTestCase()
void SignAndEncryptTest::testContent()
{
std::vector< GpgME::Key > keys = Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
......@@ -100,7 +100,7 @@ void SignAndEncryptTest::testContent()
void SignAndEncryptTest::testHeaders()
{
std::vector< GpgME::Key > keys = Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
SignJob *sJob = new SignJob(&composer);
......
......@@ -63,7 +63,7 @@ void SignEncryptTest::testContent()
QFETCH(int, cryptoMessageFormat);
QFETCH(QString, error);
std::vector< GpgME::Key > keys = Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
const QString data(QString::fromLocal8Bit("one flew over the cuckoo's nest"));
Composer composer;
......@@ -113,7 +113,7 @@ void SignEncryptTest::testContent()
void SignEncryptTest::testContentSubjobChained()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
const QByteArray data(QString::fromLocal8Bit("one flew over the cuckoo's nest").toUtf8());
KMime::Message skeletonMessage;
......@@ -155,7 +155,7 @@ void SignEncryptTest::testContentSubjobChained()
void SignEncryptTest::testHeaders()
{
std::vector< GpgME::Key > keys = Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto seJob = new SignEncryptJob(&composer);
......
......@@ -50,7 +50,7 @@ void SignJobTest::initTestCase()
void SignJobTest::testContentDirect()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto sJob = new SignJob(&composer);
......@@ -70,7 +70,7 @@ void SignJobTest::testContentDirect()
void SignJobTest::testContentChained()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
const QByteArray data(QString::fromLocal8Bit("one flew over the cuckoo's nest").toUtf8());
auto content = new KMime::Content;
......@@ -92,7 +92,7 @@ void SignJobTest::testContentChained()
void SignJobTest::testHeaders()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto sJob = new SignJob(&composer);
......@@ -124,7 +124,7 @@ void SignJobTest::testHeaders()
void SignJobTest::testRecommentationRFC3156()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
const QString data = QStringLiteral("=2D Magic foo\nFrom test\n\n-- quaak\nOhno");
KMime::Headers::contentEncoding cte = KMime::Headers::CEquPr;
......@@ -157,7 +157,7 @@ void SignJobTest::testRecommentationRFC3156()
void SignJobTest::testMixedContent()
{
std::vector< GpgME::Key > keys = MessageComposer::Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
const QString data = QStringLiteral("=2D Magic foo\nFrom test\n\n-- quaak\nOhno");
......@@ -230,7 +230,7 @@ void SignJobTest::testProtectedHeaders()
QFETCH(bool,protectedHeaders);
QFETCH(QString, referenceFile);
std::vector< GpgME::Key > keys = Test::getKeys();
const std::vector< GpgME::Key > &keys = Test::getKeys();
Composer composer;
auto sJob = new SignJob(&composer);
......
......@@ -106,7 +106,7 @@ void SignEncryptJob::setCryptoMessageFormat(Kleo::CryptoMessageFormat format)
d->format = format;
}
void SignEncryptJob::setSigningKeys(std::vector<GpgME::Key> &signers)
void SignEncryptJob::setSigningKeys(const std::vector<GpgME::Key> &signers)
{
Q_D(SignEncryptJob);
......
......@@ -52,7 +52,7 @@ public:
void setContent(KMime::Content *content);
void setCryptoMessageFormat(Kleo::CryptoMessageFormat format);
void setSigningKeys(std::vector<GpgME::Key> &signers);
void setSigningKeys(const std::vector<GpgME::Key> &signers);
void setEncryptionKeys(const std::vector<GpgME::Key> &keys) override;
void setRecipients(const QStringList &rec) override;
......
......@@ -115,7 +115,7 @@ void SignJob::setCryptoMessageFormat(Kleo::CryptoMessageFormat format)
d->format = format;
}
void SignJob::setSigningKeys(std::vector<GpgME::Key> &signers)
void SignJob::setSigningKeys(const std::vector<GpgME::Key> &signers)
{
Q_D(SignJob);
......
......@@ -50,7 +50,7 @@ public:
void setContent(KMime::Content *content);
void setCryptoMessageFormat(Kleo::CryptoMessageFormat format);
void setSigningKeys(std::vector<GpgME::Key> &signers);
void setSigningKeys(const std::vector<GpgME::Key> &signers);
void setSkeletonMessage(KMime::Message *skeletonMessage);
void setProtectedHeaders(bool protectedHeaders);
......
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