Commit 50d463f6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some forearch

parent d4f9ecf2
Pipeline #50970 passed with stage
in 42 minutes and 1 second
......@@ -39,7 +39,8 @@ KMime::Content *MimeTreeParser::findTypeInDirectChilds(KMime::Content *content,
MessagePart::Ptr MimeTreeParser::toplevelTextNode(MessagePart::Ptr messageTree)
{
foreach (const auto &mp, messageTree->subParts()) {
const auto subParts = messageTree->subParts();
for (const auto &mp : subParts) {
auto text = mp.dynamicCast<TextMessagePart>();
auto attach = mp.dynamicCast<AttachmentMessagePart>();
if (text && !attach) {
......
......@@ -1270,7 +1270,8 @@ bool EncryptedMessagePart::okDecryptMIME(KMime::Content &data)
mDecryptedData = plainText;
} else {
mNoSecKey = true;
foreach (const GpgME::DecryptionResult::Recipient &recipient, decryptResult.recipients()) {
const auto decryRecipients = decryptResult.recipients();
for (const GpgME::DecryptionResult::Recipient &recipient : decryRecipients) {
mNoSecKey &= (recipient.status().code() == GPG_ERR_NO_SECKEY);
}
if (!mPassphraseError && !mNoSecKey) { // GpgME do not detect passphrase error correctly
......
......@@ -491,7 +491,8 @@ void NodeHelper::magicSetType(KMime::Content *node, bool aAutoDecode)
bool NodeHelper::hasMailHeader(const char *header, const KMime::Content *message) const
{
if (mHeaderOverwrite.contains(message)) {
foreach (const auto messagePart, mHeaderOverwrite.value(message)) {
const auto parts = mHeaderOverwrite.value(message);
for (const auto messagePart : parts) {
if (messagePart->hasHeader(header)) {
return true;
}
......@@ -504,7 +505,8 @@ QVector<MessagePart::Ptr> NodeHelper::messagePartsOfMailHeader(const char *heade
{
QVector<MessagePart::Ptr> ret;
if (mHeaderOverwrite.contains(message)) {
foreach (const auto messagePart, mHeaderOverwrite.value(message)) {
const auto parts = mHeaderOverwrite.value(message);
for (const auto &messagePart : parts) {
if (messagePart->hasHeader(header)) {
ret << messagePart;
}
......@@ -526,7 +528,8 @@ QVector<KMime::Headers::Base *> NodeHelper::headers(const char *header, const KM
KMime::Headers::Base const *NodeHelper::mailHeaderAsBase(const char *header, const KMime::Content *message) const
{
if (mHeaderOverwrite.contains(message)) {
foreach (const auto messagePart, mHeaderOverwrite.value(message)) {
const auto parts = mHeaderOverwrite.value(message);
for (const auto &messagePart : parts) {
if (messagePart->hasHeader(header)) {
return messagePart->header(header); // Found.
}
......@@ -1099,7 +1102,8 @@ QVector<KMime::Content *> NodeHelper::attachmentsOfExtraContents() const
{
QVector<KMime::Content *> result;
for (auto it = mExtraContents.begin(), end = mExtraContents.end(); it != end; ++it) {
foreach (auto content, it.value()) {
const auto contents = it.value();
for (auto content : contents) {
if (KMime::isAttachment(content)) {
result.push_back(content);
} else {
......
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