Commit 1668195d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Clean up code

parent d18877af
...@@ -935,28 +935,27 @@ QString ViewerPrivate::writeMessageHeader(KMime::Message *aMsg, KMime::Content * ...@@ -935,28 +935,27 @@ QString ViewerPrivate::writeMessageHeader(KMime::Message *aMsg, KMime::Content *
qCCritical(MESSAGEVIEWER_LOG) << "trying to writeMessageHeader() without a header style set!"; qCCritical(MESSAGEVIEWER_LOG) << "trying to writeMessageHeader() without a header style set!";
return {}; return {};
} }
QString href; HeaderStyle *style = headerStylePlugin()->headerStyle();
if (vCardNode) { if (vCardNode) {
href = mNodeHelper->asHREF(vCardNode, QStringLiteral("body")); style->setVCardName(mNodeHelper->asHREF(vCardNode, QStringLiteral("body")));
} }
headerStylePlugin()->headerStyle()->setHeaderStrategy(headerStylePlugin()->headerStrategy()); style->setHeaderStrategy(headerStylePlugin()->headerStrategy());
headerStylePlugin()->headerStyle()->setVCardName(href); style->setPrinting(mPrinting);
headerStylePlugin()->headerStyle()->setPrinting(mPrinting); style->setTopLevel(topLevel);
headerStylePlugin()->headerStyle()->setTopLevel(topLevel); style->setAllowAsync(true);
headerStylePlugin()->headerStyle()->setAllowAsync(true); style->setSourceObject(this);
headerStylePlugin()->headerStyle()->setSourceObject(this); style->setNodeHelper(mNodeHelper);
headerStylePlugin()->headerStyle()->setNodeHelper(mNodeHelper); style->setAttachmentHtml(attachmentHtml());
headerStylePlugin()->headerStyle()->setAttachmentHtml(attachmentHtml());
if (mMessageItem.isValid()) { if (mMessageItem.isValid()) {
Akonadi::MessageStatus status; Akonadi::MessageStatus status;
status.setStatusFromFlags(mMessageItem.flags()); status.setStatusFromFlags(mMessageItem.flags());
headerStylePlugin()->headerStyle()->setMessageStatus(status); style->setMessageStatus(status);
} else { } else {
headerStylePlugin()->headerStyle()->setReadOnlyMessage(true); style->setReadOnlyMessage(true);
} }
return headerStylePlugin()->headerStyle()->format(aMsg); return style->format(aMsg);
} }
void ViewerPrivate::showVCard(KMime::Content *msgPart) void ViewerPrivate::showVCard(KMime::Content *msgPart)
......
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