Commit 8eaa0f5e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent a725ca3e
...@@ -25,15 +25,16 @@ using namespace MessageViewer; ...@@ -25,15 +25,16 @@ using namespace MessageViewer;
static AttachmentStrategy::Display smartDisplay(KMime::Content *node) static AttachmentStrategy::Display smartDisplay(KMime::Content *node)
{ {
const auto cd = node->contentDisposition(false); const auto cd = node->contentDisposition(false);
if (cd) {
if (cd && cd->disposition() == KMime::Headers::CDinline) { if (cd->disposition() == KMime::Headers::CDinline) {
// explict "inline" disposition: // explict "inline" disposition:
return AttachmentStrategy::Inline; return AttachmentStrategy::Inline;
} }
if (cd && cd->disposition() == KMime::Headers::CDattachment) { if (cd->disposition() == KMime::Headers::CDattachment) {
// explicit "attachment" disposition: // explicit "attachment" disposition:
return AttachmentStrategy::AsIcon; return AttachmentStrategy::AsIcon;
} }
}
const auto ct = node->contentType(false); const auto ct = node->contentType(false);
if (ct && ct->isText() && ct->name().trimmed().isEmpty() && (!cd || cd->filename().trimmed().isEmpty())) { if (ct && ct->isText() && ct->name().trimmed().isEmpty() && (!cd || cd->filename().trimmed().isEmpty())) {
......
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