Commit 67066ddb authored by Laurent Montel's avatar Laurent Montel 😁

Allow to show emoticon in these themes

CCBUG: 369555
parent f601f9ff
......@@ -112,7 +112,12 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath, const Grant
headerObject.insert(QStringLiteral("subjectDir"), d->headerStyleUtil.subjectDirectionString(message));
headerObject.insert(QStringLiteral("subjecti18n"), i18n("Subject:"));
headerObject.insert(QStringLiteral("subject"), d->headerStyleUtil.subjectString(message));
KTextToHTML::Options flags = KTextToHTML::PreserveSpaces;
if (MessageViewer::MessageViewerSettings::self()->showEmoticons()) {
flags |= KTextToHTML::ReplaceSmileys;
}
headerObject.insert(QStringLiteral("subject"), d->headerStyleUtil.subjectString(message, flags));
if (message->to(false)) {
headerObject.insert(QStringLiteral("toi18n"), i18n("To:"));
......
......@@ -18,7 +18,7 @@
*/
#include "plainheaderstyle.h"
#include "messageviewer/messageviewersettings.h"
#include "header/headerstyle_util.h"
#include "header/headerstrategy.h"
......@@ -108,9 +108,16 @@ QString PlainHeaderStyle::format(KMime::Message *message) const
headerStr = QStringLiteral("<div class=\"header\" dir=\"%1\">").arg(dir);
//case HdrLong:
if (strategy->showHeader(QStringLiteral("subject")))
if (strategy->showHeader(QStringLiteral("subject"))) {
KTextToHTML::Options flags = KTextToHTML::PreserveSpaces;
if (MessageViewer::MessageViewerSettings::self()->showEmoticons()) {
flags |= KTextToHTML::ReplaceSmileys;
}
headerStr += QStringLiteral("<div dir=\"%1\"><b style=\"font-size:130%\">").arg(subjectDir) +
d->mHeaderStyleUtil.subjectString(message) + QLatin1String("</b></div>\n");
d->mHeaderStyleUtil.subjectString(message, flags) + QLatin1String("</b></div>\n");
}
if (strategy->showHeader(QStringLiteral("date"))) {
headerStr.append(i18n("Date: ") + d->mHeaderStyleUtil.strToHtml(d->mHeaderStyleUtil.dateString(message, isPrinting(), /* short = */ MessageViewer::HeaderStyleUtil::CustomDate)) + QLatin1String("<br/>\n"));
......
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