summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-27 05:03:51 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-27 05:03:51 (GMT)
commit22bf8f2a9ecfe4c6686348511285d7cc522d0d08 (patch)
treed69789ff08acd8f87ab42c71374270294c6e32ac
parentf534ff26af4c77dfeb960d4819b7825202c7a528 (diff)
Make it compiles. auto keyword is not correct all the time.
it's a case where we can't use auto...
-rw-r--r--mimetreeparser/src/bodyformatter/utils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mimetreeparser/src/bodyformatter/utils.cpp b/mimetreeparser/src/bodyformatter/utils.cpp
index 88e5726..e2f7e00 100644
--- a/mimetreeparser/src/bodyformatter/utils.cpp
+++ b/mimetreeparser/src/bodyformatter/utils.cpp
@@ -53,7 +53,9 @@ KMime::Content *MimeTreeParser::findTypeInDirectChilds(KMime::Content *content,
MessagePart::Ptr MimeTreeParser::toplevelTextNode(MessagePart::Ptr messageTree)
{
foreach (const auto &mp, messageTree->subParts()) {
- if (const auto text = mp.dynamicCast<TextMessagePart>() && !mp.dynamicCast<AttachmentMessagePart>()) {
+ auto text = mp.dynamicCast<TextMessagePart>();
+ auto attach = mp.dynamicCast<AttachmentMessagePart>();
+ if (text && !attach) {
return text;
} else if (const auto alternative = mp.dynamicCast<AlternativeMessagePart>()) {
return alternative;