summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-07-28 23:17:11 +0200
committerMontel Laurent <[email protected]>2015-07-28 23:17:11 +0200
commitc996c51a0114e44c0137e44fcdbb48ddbd242bfc (patch)
tree729de8c9be633176cfbac82c11f767bf9d9f0469
parent4643de130dad9bff34935d9d9baba13b197285b0 (diff)
USe QStringLiteral
-rw-r--r--messageviewer/a11y/messagevieweraccessiblewidgetfactory.cpp2
-rw-r--r--messageviewer/adblock/adblocksettingwidget.cpp4
-rw-r--r--messageviewer/antispam/spamheaderanalyzer.cpp2
-rw-r--r--messageviewer/autotests/objecttreeparsertest.cpp10
-rw-r--r--messageviewer/autotests/todoedittest.cpp4
-rw-r--r--messageviewer/header/customheaderstyle.cpp2
-rw-r--r--messageviewer/header/entrepriseheaderstyle.cpp10
-rw-r--r--messageviewer/header/fancyheaderstyle.cpp2
-rw-r--r--messageviewer/header/grantleeheaderformatter.cpp106
-rw-r--r--messageviewer/header/plainheaderstyle.cpp12
-rw-r--r--messageviewer/job/attachmenteditjob.cpp2
-rw-r--r--messageviewer/job/attachmentencryptwithchiasmusjob.cpp2
-rw-r--r--messageviewer/scamdetection/scamdetectiondetailsdialog.cpp2
-rw-r--r--messageviewer/widgets/mailsourceviewer.cpp8
14 files changed, 84 insertions, 84 deletions
diff --git a/messageviewer/a11y/messagevieweraccessiblewidgetfactory.cpp b/messageviewer/a11y/messagevieweraccessiblewidgetfactory.cpp
index acc517b..ebf4388 100644
--- a/messageviewer/a11y/messagevieweraccessiblewidgetfactory.cpp
+++ b/messageviewer/a11y/messagevieweraccessiblewidgetfactory.cpp
@@ -36,6 +36,6 @@ MessageViewerAccessibleWidgetFactory::MessageViewerAccessibleWidgetFactory(QObje
QStringList MessageViewerAccessibleWidgetFactory::keys() const
{
QStringList l;
- l.append(QLatin1String("MessageViewer::MailWebView"));
+ l.append(QStringLiteral("MessageViewer::MailWebView"));
return l;
}
diff --git a/messageviewer/adblock/adblocksettingwidget.cpp b/messageviewer/adblock/adblocksettingwidget.cpp
index 1158c16..c63f499 100644
--- a/messageviewer/adblock/adblocksettingwidget.cpp
+++ b/messageviewer/adblock/adblocksettingwidget.cpp
@@ -200,9 +200,9 @@ void AdBlockSettingWidget::doLoadFromGlobalSettings()
// ------------------------------------------------------------------------------
// automatic filters
- KConfig config(QLatin1String("messagevieweradblockrc"));
+ KConfig config(QStringLiteral("messagevieweradblockrc"));
- const QStringList itemList = config.groupList().filter(QRegExp(QLatin1String("FilterList \\d+")));
+ const QStringList itemList = config.groupList().filter(QRegExp(QStringLiteral("FilterList \\d+")));
Q_FOREACH (const QString &item, itemList) {
KConfigGroup filtersGroup(&config, item);
const bool isFilterEnabled = filtersGroup.readEntry(QStringLiteral("FilterEnabled"), false);
diff --git a/messageviewer/antispam/spamheaderanalyzer.cpp b/messageviewer/antispam/spamheaderanalyzer.cpp
index f16445b..05a87ed 100644
--- a/messageviewer/antispam/spamheaderanalyzer.cpp
+++ b/messageviewer/antispam/spamheaderanalyzer.cpp
@@ -163,7 +163,7 @@ SpamScores SpamHeaderAnalyzer::getSpamScores(KMime::Message *message)
}
//Find the confidence
float confidence = -2.0;
- QString confidenceString = QLatin1String("-2.0");
+ QString confidenceString = QStringLiteral("-2.0");
bool confidenceValid = false;
// Do we have the needed confidence field for this agent?
const QByteArray confidenceHeaderName = (*it).confidenceHeader();
diff --git a/messageviewer/autotests/objecttreeparsertest.cpp b/messageviewer/autotests/objecttreeparsertest.cpp
index 33ced0a..15d5c7e 100644
--- a/messageviewer/autotests/objecttreeparsertest.cpp
+++ b/messageviewer/autotests/objecttreeparsertest.cpp
@@ -89,7 +89,7 @@ void ObjectTreeParserTester::test_parsePlainMessage()
void ObjectTreeParserTester::test_parseEncapsulatedMessage()
{
- KMime::Message::Ptr msg = readAndParseMail(QLatin1String("encapsulated-with-attachment.mbox"));
+ KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("encapsulated-with-attachment.mbox"));
QCOMPARE(msg->subject()->as7BitString(false).constData(), "Fwd: Test with attachment");
QCOMPARE(msg->contents().size(), 2);
@@ -125,7 +125,7 @@ void ObjectTreeParserTester::test_parseEncapsulatedMessage()
void ObjectTreeParserTester::test_missingContentTypeHeader()
{
- KMime::Message::Ptr msg = readAndParseMail(QLatin1String("no-content-type.mbox"));
+ KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("no-content-type.mbox"));
QCOMPARE(msg->subject()->as7BitString(false).constData(), "Simple Mail Without Content-Type Header");
QCOMPARE(msg->contents().size(), 0);
@@ -142,7 +142,7 @@ void ObjectTreeParserTester::test_missingContentTypeHeader()
void ObjectTreeParserTester::test_inlinePGPDecryption()
{
- KMime::Message::Ptr msg = readAndParseMail(QLatin1String("inlinepgpencrypted.mbox"));
+ KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("inlinepgpencrypted.mbox"));
QCOMPARE(msg->subject()->as7BitString(false).constData(), "inlinepgpencrypted");
QCOMPARE(msg->contents().size(), 0);
@@ -163,7 +163,7 @@ void ObjectTreeParserTester::test_inlinePGPDecryption()
void ObjectTreeParserTester::test_HTML()
{
- KMime::Message::Ptr msg = readAndParseMail(QLatin1String("html.mbox"));
+ KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("html.mbox"));
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 2);
@@ -180,7 +180,7 @@ void ObjectTreeParserTester::test_HTML()
void ObjectTreeParserTester::test_HTMLOnly()
{
- KMime::Message::Ptr msg = readAndParseMail(QLatin1String("htmlonly.mbox"));
+ KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("htmlonly.mbox"));
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 0);
diff --git a/messageviewer/autotests/todoedittest.cpp b/messageviewer/autotests/todoedittest.cpp
index af5c410..a884ea6 100644
--- a/messageviewer/autotests/todoedittest.cpp
+++ b/messageviewer/autotests/todoedittest.cpp
@@ -509,11 +509,11 @@ void TodoEditTest::shouldEnabledSaveOpenEditorButton()
QCOMPARE(openEditor->isEnabled(), true);
QCOMPARE(save->isEnabled(), true);
- noteedit->setText(QLatin1String(" "));
+ noteedit->setText(QStringLiteral(" "));
QCOMPARE(openEditor->isEnabled(), false);
QCOMPARE(save->isEnabled(), false);
- noteedit->setText(QLatin1String(" foo"));
+ noteedit->setText(QStringLiteral(" foo"));
QCOMPARE(openEditor->isEnabled(), true);
QCOMPARE(save->isEnabled(), true);
}
diff --git a/messageviewer/header/customheaderstyle.cpp b/messageviewer/header/customheaderstyle.cpp
index c89cc07..17e0ae4 100644
--- a/messageviewer/header/customheaderstyle.cpp
+++ b/messageviewer/header/customheaderstyle.cpp
@@ -53,7 +53,7 @@ QString CustomHeaderStyle::format(KMime::Message *message) const
// The direction of the header is determined according to the direction
// of the application layout.
- const QString dir = (QApplication::isRightToLeft() ? QLatin1String("rtl") : QLatin1String("ltr"));
+ const QString dir = (QApplication::isRightToLeft() ? QStringLiteral("rtl") : QStringLiteral("ltr"));
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
diff --git a/messageviewer/header/entrepriseheaderstyle.cpp b/messageviewer/header/entrepriseheaderstyle.cpp
index 6b7dbc0..bb88ceb 100644
--- a/messageviewer/header/entrepriseheaderstyle.cpp
+++ b/messageviewer/header/entrepriseheaderstyle.cpp
@@ -55,7 +55,7 @@ QString EnterpriseHeaderStyle::format(KMime::Message *message) const
// colors depend on if it is encapsulated or not
QColor fontColor(Qt::white);
- QString linkColor = QLatin1String("class =\"white\"");
+ QString linkColor = QStringLiteral("class =\"white\"");
const QColor activeColor = KColorScheme(QPalette::Active, KColorScheme::Selection).
background().color();
QColor activeColorDark = activeColor.dark(130);
@@ -63,13 +63,13 @@ QString EnterpriseHeaderStyle::format(KMime::Message *message) const
if (!isTopLevel()) {
activeColorDark = activeColor.dark(50);
fontColor = QColor(Qt::black);
- linkColor = QLatin1String("class =\"black\"");
+ linkColor = QStringLiteral("class =\"black\"");
}
QString imgpath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libmessageviewer/pics/")));
- imgpath.prepend(QLatin1String("file:///"));
- imgpath.append(QLatin1String("enterprise_"));
- const QString borderSettings(QLatin1String(" padding-top: 0px; padding-bottom: 0px; border-width: 0px "));
+ imgpath.prepend(QStringLiteral("file:///"));
+ imgpath.append(QStringLiteral("enterprise_"));
+ const QString borderSettings(QStringLiteral(" padding-top: 0px; padding-bottom: 0px; border-width: 0px "));
QString headerStr;
// 3D borders
diff --git a/messageviewer/header/fancyheaderstyle.cpp b/messageviewer/header/fancyheaderstyle.cpp
index c435e30..3e1f552 100644
--- a/messageviewer/header/fancyheaderstyle.cpp
+++ b/messageviewer/header/fancyheaderstyle.cpp
@@ -65,7 +65,7 @@ QString FancyHeaderStyle::format(KMime::Message *message) const
// The direction of the header is determined according to the direction
// of the application layout.
- const QString dir = QApplication::isRightToLeft() ? QLatin1String("rtl") : QLatin1String("ltr");
+ const QString dir = QApplication::isRightToLeft() ? QStringLiteral("rtl") : QStringLiteral("ltr");
QString headerStr = QString::fromLatin1("<div class=\"fancy header\" dir=\"%1\">\n").arg(dir);
// However, the direction of the message subject within the header is
diff --git a/messageviewer/header/grantleeheaderformatter.cpp b/messageviewer/header/grantleeheaderformatter.cpp
index 9e9a324..78671cc 100644
--- a/messageviewer/header/grantleeheaderformatter.cpp
+++ b/messageviewer/header/grantleeheaderformatter.cpp
@@ -44,7 +44,7 @@ public:
engine = new Grantlee::Engine;
templateLoader = QSharedPointer<Grantlee::FileSystemTemplateLoader>(new Grantlee::FileSystemTemplateLoader);
engine->addTemplateLoader(templateLoader);
- engine->addDefaultLibrary(QLatin1String("grantlee_messageheaderfilters"));
+ engine->addDefaultLibrary(QStringLiteral("grantlee_messageheaderfilters"));
engine->addTemplateLoader(templateLoader);
}
~Private()
@@ -101,127 +101,127 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath, Grantlee::T
// the "Re:" and "Fwd:" prefixes would always cause the subject to be
// considered left-to-right, they are ignored when determining its
// direction.
- const QString absoluteThemePath = QLatin1String("file://") + absolutePath + QLatin1Char('/');
- headerObject.insert(QLatin1String("absoluteThemePath"), absoluteThemePath);
- headerObject.insert(QLatin1String("applicationDir"), QApplication::isRightToLeft() ? QLatin1String("rtl") : QLatin1String("ltr"));
- headerObject.insert(QLatin1String("subjectDir"), MessageViewer::HeaderStyleUtil::subjectDirectionString(message));
+ const QString absoluteThemePath = QStringLiteral("file://") + absolutePath + QLatin1Char('/');
+ headerObject.insert(QStringLiteral("absoluteThemePath"), absoluteThemePath);
+ headerObject.insert(QStringLiteral("applicationDir"), QApplication::isRightToLeft() ? QStringLiteral("rtl") : QStringLiteral("ltr"));
+ headerObject.insert(QStringLiteral("subjectDir"), MessageViewer::HeaderStyleUtil::subjectDirectionString(message));
- headerObject.insert(QLatin1String("subjecti18n"), i18n("Subject:"));
- headerObject.insert(QLatin1String("subject"), MessageViewer::HeaderStyleUtil::subjectString(message));
+ headerObject.insert(QStringLiteral("subjecti18n"), i18n("Subject:"));
+ headerObject.insert(QStringLiteral("subject"), MessageViewer::HeaderStyleUtil::subjectString(message));
- headerObject.insert(QLatin1String("toi18n"), i18n("To:"));
- headerObject.insert(QLatin1String("to"), StringUtil::emailAddrAsAnchor(message->to(), StringUtil::DisplayFullAddress));
- headerObject.insert(QLatin1String("toStr"), message->to()->asUnicodeString());
+ headerObject.insert(QStringLiteral("toi18n"), i18n("To:"));
+ headerObject.insert(QStringLiteral("to"), StringUtil::emailAddrAsAnchor(message->to(), StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("toStr"), message->to()->asUnicodeString());
const QString val = MessageCore::StringUtil::emailAddrAsAnchor(message->to(), MessageCore::StringUtil::DisplayFullAddress,
QString(), MessageCore::StringUtil::ShowLink,
MessageCore::StringUtil::ExpandableAddresses, QStringLiteral("FullToAddressList"),
GlobalSettings::self()->numberOfAddressesToShow());
- headerObject.insert(QLatin1String("toExpandable"), val);
- headerObject.insert(QLatin1String("toMailbox"), QVariant::fromValue(message->to()));
+ headerObject.insert(QStringLiteral("toExpandable"), val);
+ headerObject.insert(QStringLiteral("toMailbox"), QVariant::fromValue(message->to()));
if (message->replyTo(false)) {
- headerObject.insert(QLatin1String("replyToi18n"), i18n("Reply to:"));
- headerObject.insert(QLatin1String("replyTo"), StringUtil::emailAddrAsAnchor(message->replyTo(), StringUtil::DisplayFullAddress));
- headerObject.insert(QLatin1String("replyToStr"), message->replyTo()->asUnicodeString());
+ headerObject.insert(QStringLiteral("replyToi18n"), i18n("Reply to:"));
+ headerObject.insert(QStringLiteral("replyTo"), StringUtil::emailAddrAsAnchor(message->replyTo(), StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("replyToStr"), message->replyTo()->asUnicodeString());
}
if (message->cc(false)) {
- headerObject.insert(QLatin1String("cci18n"), i18n("CC:"));
- headerObject.insert(QLatin1String("cc"), StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayFullAddress));
- headerObject.insert(QLatin1String("ccStr"), message->cc()->asUnicodeString());
- headerObject.insert(QLatin1String("ccMailbox"), QVariant::fromValue(message->cc()));
+ headerObject.insert(QStringLiteral("cci18n"), i18n("CC:"));
+ headerObject.insert(QStringLiteral("cc"), StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("ccStr"), message->cc()->asUnicodeString());
+ headerObject.insert(QStringLiteral("ccMailbox"), QVariant::fromValue(message->cc()));
const QString val = MessageCore::StringUtil::emailAddrAsAnchor(message->cc(), MessageCore::StringUtil::DisplayFullAddress,
QString(), MessageCore::StringUtil::ShowLink,
MessageCore::StringUtil::ExpandableAddresses, QStringLiteral("FullToAddressList"),
GlobalSettings::self()->numberOfAddressesToShow());
- headerObject.insert(QLatin1String("ccExpandable"), val);
+ headerObject.insert(QStringLiteral("ccExpandable"), val);
}
if (message->bcc(false)) {
- headerObject.insert(QLatin1String("bcci18n"), i18n("BCC:"));
- headerObject.insert(QLatin1String("bcc"), StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayFullAddress));
- headerObject.insert(QLatin1String("bccStr"), message->bcc()->asUnicodeString());
- headerObject.insert(QLatin1String("bccMailbox"), QVariant::fromValue(message->bcc()));
+ headerObject.insert(QStringLiteral("bcci18n"), i18n("BCC:"));
+ headerObject.insert(QStringLiteral("bcc"), StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("bccStr"), message->bcc()->asUnicodeString());
+ headerObject.insert(QStringLiteral("bccMailbox"), QVariant::fromValue(message->bcc()));
const QString val = MessageCore::StringUtil::emailAddrAsAnchor(message->bcc(), MessageCore::StringUtil::DisplayFullAddress,
QString(), MessageCore::StringUtil::ShowLink,
MessageCore::StringUtil::ExpandableAddresses, QStringLiteral("FullToAddressList"),
GlobalSettings::self()->numberOfAddressesToShow());
- headerObject.insert(QLatin1String("bccExpandable"), val);
+ headerObject.insert(QStringLiteral("bccExpandable"), val);
}
- headerObject.insert(QLatin1String("fromi18n"), i18n("From:"));
- headerObject.insert(QLatin1String("from") , StringUtil::emailAddrAsAnchor(message->from(), StringUtil::DisplayFullAddress));
- headerObject.insert(QLatin1String("fromStr") , message->from()->asUnicodeString());
+ headerObject.insert(QStringLiteral("fromi18n"), i18n("From:"));
+ headerObject.insert(QStringLiteral("from") , StringUtil::emailAddrAsAnchor(message->from(), StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("fromStr") , message->from()->asUnicodeString());
const QString spamHtml = MessageViewer::HeaderStyleUtil::spamStatus(message);
if (!spamHtml.isEmpty()) {
- headerObject.insert(QLatin1String("spamstatusi18n"), i18n("Spam Status:"));
- headerObject.insert(QLatin1String("spamHTML"), spamHtml);
+ headerObject.insert(QStringLiteral("spamstatusi18n"), i18n("Spam Status:"));
+ headerObject.insert(QStringLiteral("spamHTML"), spamHtml);
}
- headerObject.insert(QLatin1String("datei18n"), i18n("Date:"));
+ headerObject.insert(QStringLiteral("datei18n"), i18n("Date:"));
- headerObject.insert(QLatin1String("dateshort") , MessageViewer::HeaderStyleUtil::strToHtml(MessageViewer::HeaderStyleUtil::dateString(message, isPrinting, true)));
- headerObject.insert(QLatin1String("datelong") , MessageViewer::HeaderStyleUtil::strToHtml(MessageViewer::HeaderStyleUtil::dateString(message, isPrinting, false)));
- headerObject.insert(QLatin1String("date"), MessageViewer::HeaderStyleUtil::dateStr(message->date()->dateTime()));
+ headerObject.insert(QStringLiteral("dateshort") , MessageViewer::HeaderStyleUtil::strToHtml(MessageViewer::HeaderStyleUtil::dateString(message, isPrinting, true)));
+ headerObject.insert(QStringLiteral("datelong") , MessageViewer::HeaderStyleUtil::strToHtml(MessageViewer::HeaderStyleUtil::dateString(message, isPrinting, false)));
+ headerObject.insert(QStringLiteral("date"), MessageViewer::HeaderStyleUtil::dateStr(message->date()->dateTime()));
if (GlobalSettings::self()->showUserAgent()) {
if (message->headerByType("User-Agent")) {
- headerObject.insert(QLatin1String("useragent"), MessageViewer::HeaderStyleUtil::strToHtml(message->headerByType("User-Agent")->asUnicodeString()));
+ headerObject.insert(QStringLiteral("useragent"), MessageViewer::HeaderStyleUtil::strToHtml(message->headerByType("User-Agent")->asUnicodeString()));
}
if (message->headerByType("X-Mailer")) {
- headerObject.insert(QLatin1String("xmailer"), MessageViewer::HeaderStyleUtil::strToHtml(message->headerByType("X-Mailer")->asUnicodeString()));
+ headerObject.insert(QStringLiteral("xmailer"), MessageViewer::HeaderStyleUtil::strToHtml(message->headerByType("X-Mailer")->asUnicodeString()));
}
}
if (message->headerByType("Resent-From")) {
- headerObject.insert(QLatin1String("resentfromi18n"), i18n("resent from"));
+ headerObject.insert(QStringLiteral("resentfromi18n"), i18n("resent from"));
const QVector<KMime::Types::Mailbox> resentFrom = MessageViewer::HeaderStyleUtil::resentFromList(message);
- headerObject.insert(QLatin1String("resentfrom"), StringUtil::emailAddrAsAnchor(resentFrom, StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("resentfrom"), StringUtil::emailAddrAsAnchor(resentFrom, StringUtil::DisplayFullAddress));
}
if (message->headerByType("Resent-To")) {
const QVector<KMime::Types::Mailbox> resentTo = MessageViewer::HeaderStyleUtil::resentToList(message);
- headerObject.insert(QLatin1String("resenttoi18n"), i18np("receiver was", "receivers were", resentTo.count()));
- headerObject.insert(QLatin1String("resentto"), StringUtil::emailAddrAsAnchor(resentTo, StringUtil::DisplayFullAddress));
+ headerObject.insert(QStringLiteral("resenttoi18n"), i18np("receiver was", "receivers were", resentTo.count()));
+ headerObject.insert(QStringLiteral("resentto"), StringUtil::emailAddrAsAnchor(resentTo, StringUtil::DisplayFullAddress));
}
if (KMime::Headers::Base *organization = message->headerByType("Organization")) {
- headerObject.insert(QLatin1String("organization") , MessageViewer::HeaderStyleUtil::strToHtml(organization->asUnicodeString()));
+ headerObject.insert(QStringLiteral("organization") , MessageViewer::HeaderStyleUtil::strToHtml(organization->asUnicodeString()));
}
if (!style->vCardName().isEmpty()) {
- headerObject.insert(QLatin1String("vcardname") , style->vCardName());
+ headerObject.insert(QStringLiteral("vcardname") , style->vCardName());
}
if (isPrinting) {
//provide a bit more left padding when printing
//kolab/issue3254 (printed mail cut at the left side)
//Use it just for testing if we are in printing mode
- headerObject.insert(QLatin1String("isprinting") , i18n("Printing mode"));
+ headerObject.insert(QStringLiteral("isprinting") , i18n("Printing mode"));
}
// colors depend on if it is encapsulated or not
QColor fontColor(Qt::white);
- QString linkColor = QLatin1String("white");
+ QString linkColor = QStringLiteral("white");
const QColor activeColor = KColorScheme(QPalette::Active, KColorScheme::Selection).background().color();
QColor activeColorDark = activeColor.dark(130);
// reverse colors for encapsulated
if (!style->isTopLevel()) {
activeColorDark = activeColor.dark(50);
fontColor = QColor(Qt::black);
- linkColor = QLatin1String("black");
+ linkColor = QStringLiteral("black");
}
// 3D borders
- headerObject.insert(QLatin1String("activecolordark"), activeColorDark.name());
- headerObject.insert(QLatin1String("fontcolor"), fontColor.name());
- headerObject.insert(QLatin1String("linkcolor") , linkColor);
+ headerObject.insert(QStringLiteral("activecolordark"), activeColorDark.name());
+ headerObject.insert(QStringLiteral("fontcolor"), fontColor.name());
+ headerObject.insert(QStringLiteral("linkcolor") , linkColor);
MessageViewer::HeaderStyleUtil::xfaceSettings xface = MessageViewer::HeaderStyleUtil::xface(style, message);
if (!xface.photoURL.isEmpty()) {
- headerObject.insert(QLatin1String("photowidth") , xface.photoWidth);
- headerObject.insert(QLatin1String("photoheight") , xface.photoHeight);
- headerObject.insert(QLatin1String("photourl") , xface.photoURL);
+ headerObject.insert(QStringLiteral("photowidth") , xface.photoWidth);
+ headerObject.insert(QStringLiteral("photoheight") , xface.photoHeight);
+ headerObject.insert(QStringLiteral("photourl") , xface.photoURL);
}
Q_FOREACH (QString header, displayExtraHeaders) {
@@ -233,10 +233,10 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath, Grantlee::T
}
}
- headerObject.insert(QLatin1String("vcardi18n"), i18n("[vcard]"));
+ headerObject.insert(QStringLiteral("vcardi18n"), i18n("[vcard]"));
QVariantHash mapping;
- mapping.insert(QLatin1String("header"), headerObject);
+ mapping.insert(QStringLiteral("header"), headerObject);
Grantlee::Context context(mapping);
return headerTemplate->render(&context);
diff --git a/messageviewer/header/plainheaderstyle.cpp b/messageviewer/header/plainheaderstyle.cpp
index f81bfd1..cd3ed55 100644
--- a/messageviewer/header/plainheaderstyle.cpp
+++ b/messageviewer/header/plainheaderstyle.cpp
@@ -49,7 +49,7 @@ QString PlainHeaderStyle::format(KMime::Message *message) const
// The direction of the header is determined according to the direction
// of the application layout.
- QString dir = QApplication::isRightToLeft() ? QLatin1String("rtl") : QLatin1String("ltr");
+ QString dir = QApplication::isRightToLeft() ? QStringLiteral("rtl") : QStringLiteral("ltr");
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
@@ -72,7 +72,7 @@ QString PlainHeaderStyle::format(KMime::Message *message) const
headerStr = QString::fromLatin1("<div class=\"header\" dir=\"%1\">").arg(dir);
//case HdrLong:
- if (strategy->showHeader(QLatin1String("subject")))
+ if (strategy->showHeader(QStringLiteral("subject")))
headerStr += QString::fromLatin1("<div dir=\"%1\"><b style=\"font-size:130%\">").arg(subjectDir) +
MessageViewer::HeaderStyleUtil::subjectString(message) + QLatin1String("</b></div>\n");
@@ -98,19 +98,19 @@ QString PlainHeaderStyle::format(KMime::Message *message) const
headerStr.append(QLatin1String("<br/>\n"));
}
- if (strategy->showHeader(QLatin1String("to")))
+ if (strategy->showHeader(QStringLiteral("to")))
headerStr.append(i18nc("To-field of the mailheader.", "To: ") +
StringUtil::emailAddrAsAnchor(message->to(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n"));
- if (strategy->showHeader(QLatin1String("cc")) && message->cc(false))
+ if (strategy->showHeader(QStringLiteral("cc")) && message->cc(false))
headerStr.append(i18n("CC: ") +
StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n"));
- if (strategy->showHeader(QLatin1String("bcc")) && message->bcc(false))
+ if (strategy->showHeader(QStringLiteral("bcc")) && message->bcc(false))
headerStr.append(i18n("BCC: ") +
StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n"));
- if (strategy->showHeader(QLatin1String("reply-to")) && message->replyTo(false))
+ if (strategy->showHeader(QStringLiteral("reply-to")) && message->replyTo(false))
headerStr.append(i18n("Reply to: ") +
StringUtil::emailAddrAsAnchor(message->replyTo(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n"));
diff --git a/messageviewer/job/attachmenteditjob.cpp b/messageviewer/job/attachmenteditjob.cpp
index 510b150..a8bd3fc 100644
--- a/messageviewer/job/attachmenteditjob.cpp
+++ b/messageviewer/job/attachmenteditjob.cpp
@@ -45,7 +45,7 @@ bool AttachmentEditJob::addAttachment(KMime::Content *node, bool showWarning)
if (showWarning && KMessageBox::warningContinueCancel(mMainWindow,
i18n("Modifying an attachment might invalidate any digital signature on this message."),
i18n("Edit Attachment"), KGuiItem(i18n("Edit"), QStringLiteral("document-properties")), KStandardGuiItem::cancel(),
- QLatin1String("EditAttachmentSignatureWarning"))
+ QStringLiteral("EditAttachmentSignatureWarning"))
!= KMessageBox::Continue) {
return false;
}
diff --git a/messageviewer/job/attachmentencryptwithchiasmusjob.cpp b/messageviewer/job/attachmentencryptwithchiasmusjob.cpp
index fae042e..493a0ff 100644
--- a/messageviewer/job/attachmentencryptwithchiasmusjob.cpp
+++ b/messageviewer/job/attachmentencryptwithchiasmusjob.cpp
@@ -74,7 +74,7 @@ void AttachmentEncryptWithChiasmusJob::start()
Q_UNUSED(mContent);
// FIXME: better detection of mimetype??
- if (!mCurrentFileName.endsWith(QLatin1String(".xia"), Qt::CaseInsensitive)) {
+ if (!mCurrentFileName.endsWith(QStringLiteral(".xia"), Qt::CaseInsensitive)) {
deleteLater();
return;
}
diff --git a/messageviewer/scamdetection/scamdetectiondetailsdialog.cpp b/messageviewer/scamdetection/scamdetectiondetailsdialog.cpp
index fdbe04a..f5c65ad 100644
--- a/messageviewer/scamdetection/scamdetectiondetailsdialog.cpp
+++ b/messageviewer/scamdetection/scamdetectiondetailsdialog.cpp
@@ -82,7 +82,7 @@ void ScamDetectionDetailsDialog::slotSaveAs()
QTextStream ts(&file);
ts.setCodec("UTF-8");
QString htmlStr = mDetails->toHtml();
- htmlStr.replace(QLatin1String("meta name=\"qrichtext\" content=\"1\""), QStringLiteral("meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\""));
+ htmlStr.replace(QStringLiteral("meta name=\"qrichtext\" content=\"1\""), QStringLiteral("meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\""));
ts << htmlStr;
file.close();
}
diff --git a/messageviewer/widgets/mailsourceviewer.cpp b/messageviewer/widgets/mailsourceviewer.cpp
index b3bfa95..94326dd 100644
--- a/messageviewer/widgets/mailsourceviewer.cpp
+++ b/messageviewer/widgets/mailsourceviewer.cpp
@@ -142,13 +142,13 @@ void MailSourceViewer::setFixedFont()
QString MailSourceViewer::reformat(const QString &src)
{
- const QRegExp cleanLeadingWhitespace(QLatin1String("(?:\\n)+\\w*"));
+ const QRegExp cleanLeadingWhitespace(QStringLiteral("(?:\\n)+\\w*"));
QStringList tmpSource;
QString source(src);
int pos = 0;
QString indent;
// Best to be really verbose about this one...
- const static QRegExp htmlTagRegExp(QLatin1String("<"
+ const static QRegExp htmlTagRegExp(QStringLiteral("<"
"(/)?" //Captures the / if this is an end tag.
"(\\w+)" //Captures TagName
"(?:" //Groups tag contents
@@ -202,7 +202,7 @@ QString MailSourceViewer::reformat(const QString &src)
}
// start tag
tmpSource[i].prepend(indent);
- indent.append(QLatin1String(" "));
+ indent.append(QStringLiteral(" "));
continue;
}
// Data
@@ -210,7 +210,7 @@ QString MailSourceViewer::reformat(const QString &src)
}
// Finally reassemble and return :)
- return tmpSource.join(QLatin1String("\n"));
+ return tmpSource.join(QStringLiteral("\n"));
}
}