Commit fdb402af authored by Laurent Montel's avatar Laurent Montel
Browse files

Launch clang-format as it seems that it was disabled when pushed these changes...

parent 715d45ab
Pipeline #243373 passed with stage
in 15 minutes and 36 seconds
......@@ -2236,12 +2236,12 @@ KMime::Message::Ptr ComposerViewBase::msg() const
NearExpiryChecker::Ptr ComposerViewBase::nearExpiryChecker()
{
if (!mNearExpiryChecker) {
mNearExpiryChecker = NearExpiryChecker::Ptr(new NearExpiryChecker(encryptKeyNearExpiryWarningThresholdInDays(),
signingKeyNearExpiryWarningThresholdInDays(),
encryptRootCertNearExpiryWarningThresholdInDays(),
signingRootCertNearExpiryWarningThresholdInDays(),
encryptChainCertNearExpiryWarningThresholdInDays(),
signingChainCertNearExpiryWarningThresholdInDays()));
mNearExpiryChecker = NearExpiryChecker::Ptr(new NearExpiryChecker(encryptKeyNearExpiryWarningThresholdInDays(),
signingKeyNearExpiryWarningThresholdInDays(),
encryptRootCertNearExpiryWarningThresholdInDays(),
signingRootCertNearExpiryWarningThresholdInDays(),
encryptChainCertNearExpiryWarningThresholdInDays(),
signingChainCertNearExpiryWarningThresholdInDays()));
}
return mNearExpiryChecker;
}
......@@ -12,7 +12,7 @@ using namespace MessageComposer;
ContactPreference::ContactPreference() = default;
void ContactPreference::fillFromAddressee(const KContacts::Addressee& contact)
void ContactPreference::fillFromAddressee(const KContacts::Addressee &contact)
{
const QString encryptPref = contact.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOENCRYPTPREF"));
encryptionPreference = Kleo::stringToEncryptionPreference(encryptPref);
......@@ -24,17 +24,13 @@ void ContactPreference::fillFromAddressee(const KContacts::Addressee& contact)
smimeCertFingerprints = contact.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("SMIMEFP")).split(QLatin1Char(','), Qt::SkipEmptyParts);
}
void ContactPreference::fillAddressee(KContacts::Addressee& contact) const
void ContactPreference::fillAddressee(KContacts::Addressee &contact) const
{
contact.insertCustom(QStringLiteral("KADDRESSBOOK"),
QStringLiteral("CRYPTOENCRYPTPREF"),
QLatin1String(Kleo::encryptionPreferenceToString(encryptionPreference)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"),
QStringLiteral("CRYPTOSIGNPREF"),
QLatin1String(Kleo::signingPreferenceToString(signingPreference)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"),
QStringLiteral("CRYPTOPROTOPREF"),
QLatin1String(cryptoMessageFormatToString(cryptoMessageFormat)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOSIGNPREF"), QLatin1String(Kleo::signingPreferenceToString(signingPreference)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF"), QLatin1String(cryptoMessageFormatToString(cryptoMessageFormat)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("OPENPGPFP"), pgpKeyFingerprints.join(QLatin1Char(',')));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("SMIMEFP"), smimeCertFingerprints.join(QLatin1Char(',')));
}
......@@ -33,7 +33,7 @@ public:
SaveContactPreferenceJob *q_ptr;
Q_DECLARE_PUBLIC(SaveContactPreferenceJob)
const QString mEmail;
const ContactPreference mPref;
};
......@@ -49,7 +49,7 @@ SaveContactPreferenceJob::~SaveContactPreferenceJob() = default;
void SaveContactPreferenceJob::start()
{
Q_D(SaveContactPreferenceJob);
auto job = new Akonadi::ContactSearchJob(this);
connect(job, &Akonadi::ContactSearchJob::result, this, &SaveContactPreferenceJob::slotSearchContact);
job->setLimit(1);
......@@ -115,7 +115,6 @@ void SaveContactPreferenceJob::slotSearchContact(KJob *job)
}
}
void SaveContactPreferenceJob::slotModifyCreateItem(KJob *job)
{
if (job->error()) {
......
......@@ -67,14 +67,13 @@ void MessageCore::processAutocryptfromMail(const HeaderMixupNodeHelper &mixup)
auto storage = AutocryptStorage::self();
QByteArray messageid = "<NO Message-ID header>";
if (mixup.mailHeaderAsBase("Message-ID")) {
if (mixup.mailHeaderAsBase("Message-ID")) {
messageid = mixup.mailHeaderAsBase("Message-ID")->as7BitString(false);
}
const auto fromAddr = mixup.mailHeaderAsAddressList("from");
if (fromAddr->addresses().size() != 1) {
qInfo(AUTOCRYPT_LOG) << "Don't update Autocrypt storage, none or multiple From headers found in "
<< messageid;
qInfo(AUTOCRYPT_LOG) << "Don't update Autocrypt storage, none or multiple From headers found in " << messageid;
return;
}
......@@ -113,18 +112,15 @@ void MessageCore::processAutocryptfromMail(const HeaderMixupNodeHelper &mixup)
const auto params = paramsFromAutocryptHeader(header);
auto recipient = storage->addRecipient(params.value("addr"));
recipient->updateFromMessage(mixup, header);
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt information for " << recipient->addr() << " from "
<< messageid;
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt information for " << recipient->addr() << " from " << messageid;
} else {
qInfo(AUTOCRYPT_LOG) << "Don't update Autocrypt storage, because we have multiple valid Autocrypt headers found in "
<< messageid;
qInfo(AUTOCRYPT_LOG) << "Don't update Autocrypt storage, because we have multiple valid Autocrypt headers found in " << messageid;
}
} else {
auto recipient = storage->getRecipient(fromAddr->addresses().value(0));
if (recipient) {
recipient->updateFromMessage(mixup, nullptr);
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt information for " << recipient->addr() << " from "
<< messageid;
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt information for " << recipient->addr() << " from " << messageid;
}
}
......@@ -141,8 +137,7 @@ void MessageCore::processAutocryptfromMail(const HeaderMixupNodeHelper &mixup)
const auto params = paramsFromAutocryptHeader(header);
auto recipient = storage->addRecipient(params.value("addr"));
recipient->updateFromGossip(mixup, header);
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt Gossip information for" << recipient->addr() << " from "
<< messageid;
qInfo(AUTOCRYPT_LOG) << "Update Autocrypt Gossip information for" << recipient->addr() << " from " << messageid;
}
}
}
......
......@@ -16,8 +16,8 @@
#include "bodyformatter/utils.h"
#include <Libkleo/KeyCache>
#include <KMime/Content>
#include <Libkleo/KeyCache>
#include <QGpgME/DN>
#include <QGpgME/ImportJob>
......@@ -862,7 +862,7 @@ void SignedMessagePart::sigStatusToMetaData()
if (key.numUserIDs() > 0 && key.userID(0).id()) {
partMetaData()->signer = prettifyDN(key.userID(0).id());
}
for (const auto &uid: key.userIDs()) {
for (const auto &uid : key.userIDs()) {
// The following if /should/ always result in TRUE but we
// won't trust implicitly the plugin that gave us these data.
if (uid.email()) {
......
Supports Markdown
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