summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-07 08:01:50 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-07 08:01:50 (GMT)
commite9c579ea85ba3d4f98384c2033a3b86a6f709101 (patch)
treeb925d7c3a45885bdc853225bdd65b00ff4f2347b
parent41c43a51894505d32b4a7697b04a23e55e7201a4 (diff)
Minor optimization
-rw-r--r--messagecomposer/src/composer/composerviewbase.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/messagecomposer/src/composer/composerviewbase.cpp b/messagecomposer/src/composer/composerviewbase.cpp
index 6210540..670f4f6 100644
--- a/messagecomposer/src/composer/composerviewbase.cpp
+++ b/messagecomposer/src/composer/composerviewbase.cpp
@@ -206,12 +206,13 @@ void MessageComposer::ComposerViewBase::setMessage(const KMime::Message::Ptr &ms
}
// Set the HTML text and collect HTML images
- if (!otp.htmlContent().isEmpty()) {
- m_editor->setHtml(otp.htmlContent());
+ const QString htmlContent = otp.htmlContent();
+ if (htmlContent.isEmpty()) {
+ m_editor->setPlainText(otp.plainTextContent());
+ } else {
+ m_editor->setHtml(htmlContent);
Q_EMIT enableHtml();
collectImages(m_msg.data());
- } else {
- m_editor->setPlainText(otp.plainTextContent());
}
if (auto hdr = m_msg->headerByType("X-KMail-CursorPos")) {