summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-15 13:57:19 +0100
committerLaurent Montel <[email protected]>2018-02-15 13:57:19 +0100
commit121f49f91288c5cd2a569591957480d82664d180 (patch)
tree85f541d2c828f4c44bcb3080ea0b00954bff28d6
parent9ac54dabaffa0603c725a217d8da4bd1a468ea1d (diff)
COnst'ify + rename method
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer.cpp4
-rw-r--r--messageviewer/src/viewer/objecttreeviewersource.cpp2
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp6
-rw-r--r--messageviewer/src/viewer/viewer_p.h2
-rw-r--r--mimetreeparser/src/bodypartformatter.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
index c665a65..2c4c1bf 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
@@ -359,7 +359,7 @@ void DefaultRendererPrivate::render(const MimeMessagePart::Ptr &mp, HtmlWriter *
if (mp->isAttachment()) {
aBlock = HTMLBlock::Ptr(new AttachmentMarkBlock(htmlWriter, mp->attachmentContent()));
}
-
+ auto preferredMode = mp->source()->preferredMode();
if (mp->isRoot()) {
rBlock = HTMLBlock::Ptr(new RootBlock(htmlWriter));
}
@@ -403,7 +403,7 @@ void DefaultRendererPrivate::render(const HtmlMessagePart::Ptr &mp, HtmlWriter *
c.insert(QStringLiteral("block"), &block);
auto preferredMode = mp->source()->preferredMode();
- bool isHtmlPreferred = (preferredMode == MimeTreeParser::Util::Html) || (preferredMode == MimeTreeParser::Util::MultipartHtml);
+ const bool isHtmlPreferred = (preferredMode == MimeTreeParser::Util::Html) || (preferredMode == MimeTreeParser::Util::MultipartHtml);
block.setProperty("htmlMail", isHtmlPreferred);
block.setProperty("loadExternal", htmlLoadExternal());
block.setProperty("isPrinting", isPrinting());
diff --git a/messageviewer/src/viewer/objecttreeviewersource.cpp b/messageviewer/src/viewer/objecttreeviewersource.cpp
index 8a63481..74a47ec 100644
--- a/messageviewer/src/viewer/objecttreeviewersource.cpp
+++ b/messageviewer/src/viewer/objecttreeviewersource.cpp
@@ -97,7 +97,7 @@ const QTextCodec *MailViewerSource::overrideCodec()
QString MailViewerSource::createMessageHeader(KMime::Message *message)
{
- return mViewer->writeMsgHeader(message);
+ return mViewer->writeMessageHeader(message);
}
const AttachmentStrategy *MailViewerSource::attachmentStrategy() const
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index 7a79027..7e1382a 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -989,7 +989,7 @@ void ViewerPrivate::parseContent(KMime::Content *content)
KMime::Message *message = dynamic_cast<KMime::Message *>(content);
if (message) {
- htmlWriter()->write(writeMsgHeader(message, hasVCard ? vCardContent : nullptr, true));
+ htmlWriter()->write(writeMessageHeader(message, hasVCard ? vCardContent : nullptr, true));
}
// Pass control to the OTP now, which does the real work
@@ -1021,10 +1021,10 @@ void ViewerPrivate::parseContent(KMime::Content *content)
showHideMimeTree();
}
-QString ViewerPrivate::writeMsgHeader(KMime::Message *aMsg, KMime::Content *vCardNode, bool topLevel)
+QString ViewerPrivate::writeMessageHeader(KMime::Message *aMsg, KMime::Content *vCardNode, bool topLevel)
{
if (!headerStylePlugin()) {
- qCCritical(MESSAGEVIEWER_LOG) << "trying to writeMsgHeader() without a header style set!";
+ qCCritical(MESSAGEVIEWER_LOG) << "trying to writeMessageHeader() without a header style set!";
return {};
}
QString href;
diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h
index 57a0ccf..fff1b80 100644
--- a/messageviewer/src/viewer/viewer_p.h
+++ b/messageviewer/src/viewer/viewer_p.h
@@ -274,7 +274,7 @@ public:
/** Creates a nice mail header depending on the current selected
header style. */
- QString writeMsgHeader(KMime::Message *aMsg, KMime::Content *vCardNode = nullptr, bool topLevel = false);
+ QString writeMessageHeader(KMime::Message *aMsg, KMime::Content *vCardNode = nullptr, bool topLevel = false);
/** show window containing information about a vCard. */
void showVCard(KMime::Content *msgPart);
diff --git a/mimetreeparser/src/bodypartformatter.cpp b/mimetreeparser/src/bodypartformatter.cpp
index 239d479..de7f4bc 100644
--- a/mimetreeparser/src/bodypartformatter.cpp
+++ b/mimetreeparser/src/bodypartformatter.cpp
@@ -106,7 +106,7 @@ public:
part.processResult()->setInlineEncryptionState(mp->encryptionState());
auto preferredMode = part.source()->preferredMode();
- bool isHtmlPreferred = (preferredMode == Util::Html) || (preferredMode == Util::MultipartHtml);
+ const bool isHtmlPreferred = (preferredMode == Util::Html) || (preferredMode == Util::MultipartHtml);
if (node->parent() && node->parent()->contentType()->subType() == "related" && isHtmlPreferred) {
part.nodeHelper()->setNodeDisplayedEmbedded(node, true);
part.nodeHelper()->setNodeDisplayedHidden(node, true);