Commit 3906a702 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 08e8891d
...@@ -549,16 +549,17 @@ void ViewerPrivate::showAttachmentPopup(KMime::Content *node, const QString &nam ...@@ -549,16 +549,17 @@ void ViewerPrivate::showAttachmentPopup(KMime::Content *node, const QString &nam
Q_UNUSED(name) Q_UNUSED(name)
prepareHandleAttachment(node); prepareHandleAttachment(node);
bool deletedAttachment = false; bool deletedAttachment = false;
if (node->contentType(false)) { QString contentTypeStr;
deletedAttachment = (node->contentType()->mimeType() == "text/x-moz-deleted"); if (auto contentType = node->contentType(false)) {
contentTypeStr = QLatin1String(contentType->mimeType());
} }
deletedAttachment = (contentTypeStr == QStringLiteral("text/x-moz-deleted"));
//Not necessary to show popup menu when attachment was removed //Not necessary to show popup menu when attachment was removed
if (deletedAttachment) { if (deletedAttachment) {
return; return;
} }
QMenu menu; QMenu menu;
const QString contentTypeStr = QLatin1String(node->contentType()->mimeType());
QAction *action QAction *action
= menu.addAction(QIcon::fromTheme(QStringLiteral("document-open")), i18nc("to open", = menu.addAction(QIcon::fromTheme(QStringLiteral("document-open")), i18nc("to open",
......
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