summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-01-24 22:13:08 +0100
committerLaurent Montel <[email protected]>2018-01-24 22:13:08 +0100
commit4579ea34a04db51f9c5ec3f1b6c6447cee02c928 (patch)
tree6679bca77d94e4b9dbe853a55cbf63aa4bbeafac
parent47554af6236cfbc79bfb6d8cbff328704fcfe0f3 (diff)
Use QLatin1String
-rw-r--r--messagecomposer/src/attachment/attachmentcontrollerbase.cpp6
-rw-r--r--messagecomposer/src/helper/messagefactoryng.cpp4
-rw-r--r--messagecomposer/src/plugineditor/plugineditormanager.cpp2
-rw-r--r--messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp2
-rw-r--r--messagecomposer/src/plugineditorinit/plugineditorinitmanager.cpp2
-rw-r--r--messageviewer/src/header/contactdisplaymessagememento.cpp4
-rw-r--r--messageviewer/src/header/headerstylepluginmanager.cpp2
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp18
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer.cpp6
-rw-r--r--messageviewer/src/scamdetection/scamdetectionwebengine.cpp6
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp6
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp2
-rw-r--r--mimetreeparser/src/bodyformatter/mailman.cpp2
-rw-r--r--mimetreeparser/src/nodehelper.cpp2
-rw-r--r--templateparser/src/templatesconfiguration.cpp4
-rw-r--r--webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp2
16 files changed, 35 insertions, 35 deletions
diff --git a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
index 2b09d87..7878aee 100644
--- a/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
+++ b/messagecomposer/src/attachment/attachmentcontrollerbase.cpp
@@ -597,9 +597,9 @@ void AttachmentControllerBase::showContextMenu()
if ((mimetype == QLatin1String("text/plain"))
|| (mimetype == QLatin1String("image/png"))
|| (mimetype == QLatin1String("image/jpeg"))
- || parentMimeType.contains(QStringLiteral("text/plain"))
- || parentMimeType.contains(QStringLiteral("image/png"))
- || parentMimeType.contains(QStringLiteral("image/jpeg"))
+ || parentMimeType.contains(QLatin1String("text/plain"))
+ || parentMimeType.contains(QLatin1String("image/png"))
+ || parentMimeType.contains(QLatin1String("image/jpeg"))
) {
menu.addAction(d->viewContextAction);
}
diff --git a/messagecomposer/src/helper/messagefactoryng.cpp b/messagecomposer/src/helper/messagefactoryng.cpp
index f666dfc..9c8a8ed 100644
--- a/messagecomposer/src/helper/messagefactoryng.cpp
+++ b/messagecomposer/src/helper/messagefactoryng.cpp
@@ -132,7 +132,7 @@ void MessageFactoryNG::createReplyAsync()
if (auto hdr = m_origMsg->headerByType("List-Post")) {
const QString hdrListPost = hdr->asUnicodeString();
- if (hdrListPost.contains(QStringLiteral("mailto:"), Qt::CaseInsensitive)) {
+ if (hdrListPost.contains(QLatin1String("mailto:"), Qt::CaseInsensitive)) {
QRegExp rx(QStringLiteral("<mailto:([^@>]+)@([^>]+)>"), Qt::CaseInsensitive);
if (rx.indexIn(hdrListPost, 0) != -1) { // matched
KMime::Types::Mailbox mailbox;
@@ -938,7 +938,7 @@ bool MessageFactoryNG::MDNMDNUnknownOption(const KMime::Message::Ptr &msg)
if (auto hrd = msg->headerByType("Disposition-Notification-Options")) {
notificationOptions = hrd->asUnicodeString();
}
- if (notificationOptions.contains(QStringLiteral("required"), Qt::CaseSensitive)) {
+ if (notificationOptions.contains(QLatin1String("required"), Qt::CaseSensitive)) {
// ### hacky; should parse...
// There is a required option that we don't understand. We need to
// ask the user what we should do:
diff --git a/messagecomposer/src/plugineditor/plugineditormanager.cpp b/messagecomposer/src/plugineditor/plugineditormanager.cpp
index 7d83757..e143a61 100644
--- a/messagecomposer/src/plugineditor/plugineditormanager.cpp
+++ b/messagecomposer/src/plugineditor/plugineditormanager.cpp
@@ -77,7 +77,7 @@ private:
bool PluginEditorManagerPrivate::initializePlugins()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("kmail"), [](const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("KMailEditor/Plugin"));
+ return md.serviceTypes().contains(QLatin1String("KMailEditor/Plugin"));
});
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
diff --git a/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp b/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
index 80007b6..02c3b57 100644
--- a/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
+++ b/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
@@ -89,7 +89,7 @@ QVector<PimCommon::PluginUtilData> PluginEditorCheckBeforeSendManagerPrivate::pl
bool PluginEditorCheckBeforeSendManagerPrivate::initializePlugins()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("kmail"), [](const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("KMailEditor/PluginCheckBeforeSend"));
+ return md.serviceTypes().contains(QLatin1String("KMailEditor/PluginCheckBeforeSend"));
});
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
diff --git a/messagecomposer/src/plugineditorinit/plugineditorinitmanager.cpp b/messagecomposer/src/plugineditorinit/plugineditorinitmanager.cpp
index 72c2bf0..49a987c 100644
--- a/messagecomposer/src/plugineditorinit/plugineditorinitmanager.cpp
+++ b/messagecomposer/src/plugineditorinit/plugineditorinitmanager.cpp
@@ -89,7 +89,7 @@ QVector<PimCommon::PluginUtilData> PluginEditorInitManagerPrivate::pluginsDataLi
bool PluginEditorInitManagerPrivate::initializePlugins()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("kmail"), [](const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("KMailEditor/PluginEditorInit"));
+ return md.serviceTypes().contains(QLatin1String("KMailEditor/PluginEditorInit"));
});
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
diff --git a/messageviewer/src/header/contactdisplaymessagememento.cpp b/messageviewer/src/header/contactdisplaymessagememento.cpp
index a983322..ab3244e 100644
--- a/messageviewer/src/header/contactdisplaymessagememento.cpp
+++ b/messageviewer/src/header/contactdisplaymessagememento.cpp
@@ -176,7 +176,7 @@ void ContactDisplayMessageMemento::processAddress(const KContacts::Addressee &ad
{
const QStringList customs = addressee.customs();
for (const QString &custom : customs) {
- if (custom.contains(QStringLiteral("MailPreferedFormatting"))) {
+ if (custom.contains(QLatin1String("MailPreferedFormatting"))) {
const QString value
= addressee.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral(
"MailPreferedFormatting"));
@@ -187,7 +187,7 @@ void ContactDisplayMessageMemento::processAddress(const KContacts::Addressee &ad
} else {
mForceDisplayTo = Viewer::UseGlobalSetting;
}
- } else if (custom.contains(QStringLiteral("MailAllowToRemoteContent"))) {
+ } else if (custom.contains(QLatin1String("MailAllowToRemoteContent"))) {
const QString value
= addressee.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral(
"MailAllowToRemoteContent"));
diff --git a/messageviewer/src/header/headerstylepluginmanager.cpp b/messageviewer/src/header/headerstylepluginmanager.cpp
index 5536ef6..d227f38 100644
--- a/messageviewer/src/header/headerstylepluginmanager.cpp
+++ b/messageviewer/src/header/headerstylepluginmanager.cpp
@@ -92,7 +92,7 @@ void HeaderStylePluginManagerPrivate::initializePluginList()
const QVector<KPluginMetaData> plugins
= KPluginLoader::findPlugins(QStringLiteral("messageviewer"), [](
const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("MessageViewerHeaderStyle/Plugin"));
+ return md.serviceTypes().contains(QLatin1String("MessageViewerHeaderStyle/Plugin"));
});
QVectorIterator<KPluginMetaData> i(plugins);
diff --git a/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp b/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
index 9db9379..7b414e8 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
@@ -205,7 +205,7 @@ void ObjectTreeParserTester::test_HTML()
otp.parseObjectTree(msg.data());
QCOMPARE(otp.plainTextContent().toLatin1().data(), "Some HTML text");
- QVERIFY(otp.htmlContent().contains(QStringLiteral(
+ QVERIFY(otp.htmlContent().contains(QLatin1String(
"Some <span style=\" font-weight:600;\">HTML</span> text")));
QCOMPARE(otp.htmlContentCharset().data(), "windows-1252");
}
@@ -245,7 +245,7 @@ void ObjectTreeParserTester::test_HTMLOnly()
otp.parseObjectTree(msg.data());
QVERIFY(otp.plainTextContent().isEmpty());
- QVERIFY(otp.htmlContent().contains(QStringLiteral("<b>SOME</b> HTML text.")));
+ QVERIFY(otp.htmlContent().contains(QLatin1String("<b>SOME</b> HTML text.")));
}
void ObjectTreeParserTester::test_HTMLOnlyText()
@@ -266,7 +266,7 @@ void ObjectTreeParserTester::test_HTMLOnlyText()
testWriter.end();
QVERIFY(otp.plainTextContent().isEmpty());
- QVERIFY(otp.htmlContent().contains(QStringLiteral("<b>SOME</b> HTML text.")));
+ QVERIFY(otp.htmlContent().contains(QLatin1String("<b>SOME</b> HTML text.")));
QVERIFY(testWriter.data().contains("This is an HTML message. For security reasons, only the raw HTML code is shown."));
QVERIFY(testWriter.data().contains("SOME* HTML text. <br>"));
}
@@ -289,7 +289,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
testWriter.end();
QVERIFY(otp.plainTextContent().isEmpty());
- QVERIFY(otp.htmlContent().contains(QStringLiteral("<b>SOME</b> HTML text.")));
+ QVERIFY(otp.htmlContent().contains(QLatin1String("<b>SOME</b> HTML text.")));
QVERIFY(testWriter.data().contains("<b>SOME</b> HTML text."));
QVERIFY(testWriter.data().contains("This HTML message may contain external references to images etc. For security/privacy reasons external references are not loaded."));
}
@@ -304,7 +304,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
otp.parseObjectTree(msg.data());
testWriter.end();
- QVERIFY(otp.htmlContent().contains(QStringLiteral("<b>SOME</b> HTML text.")));
+ QVERIFY(otp.htmlContent().contains(QLatin1String("<b>SOME</b> HTML text.")));
QVERIFY(testWriter.data().contains("<b>SOME</b> HTML text."));
QVERIFY(!testWriter.data().contains("This HTML message may contain external references to images etc. For security/privacy reasons external references are not loaded."));
}
@@ -326,7 +326,7 @@ void ObjectTreeParserTester::test_Alternative()
testWriter.end();
QVERIFY(otp.htmlContent().isEmpty());
- QVERIFY(otp.plainTextContent().contains(QStringLiteral(
+ QVERIFY(otp.plainTextContent().contains(QLatin1String(
"If you can see this text it means that your email client couldn't display our newsletter properly.")));
QVERIFY(testWriter.data().contains("If you can see this text it means that your email client couldn't display our newsletter properly."));
}
@@ -342,9 +342,9 @@ void ObjectTreeParserTester::test_Alternative()
otp.parseObjectTree(msg.data());
testWriter.end();
- QVERIFY(otp.plainTextContent().contains(QStringLiteral(
+ QVERIFY(otp.plainTextContent().contains(QLatin1String(
"If you can see this text it means that your email client couldn't display our newsletter properly.")));
- QVERIFY(otp.htmlContent().contains(QStringLiteral(
+ QVERIFY(otp.htmlContent().contains(QLatin1String(
"Some <span style=\" font-weight:600;\">HTML</span> text</p>")));
QVERIFY(testWriter.data().contains("Some <span style=\" font-weight:600;\">HTML</span> text</p>"));
}
@@ -379,7 +379,7 @@ void ObjectTreeParserTester::test_Alternative()
testWriter.end();
QVERIFY(otp.plainTextContent().isEmpty());
- QVERIFY(otp.htmlContent().contains(QStringLiteral(
+ QVERIFY(otp.htmlContent().contains(QLatin1String(
"Some <span style=\" font-weight:600;\">HTML</span> text</p>")));
QVERIFY(testWriter.data().contains("Some <span style=\" font-weight:600;\">HTML</span> text</p>"));
}
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
index fd1211e..48608d1 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
@@ -240,10 +240,10 @@ QString sigStatusToString(const QGpgME::Protocol *cryptProto, int status_code, G
bool containsExternalReferences(const QString &str, const QString &extraHead)
{
- const bool hasBaseInHeader = extraHead.contains(QStringLiteral(
+ const bool hasBaseInHeader = extraHead.contains(QLatin1String(
"<base href=\""), Qt::CaseInsensitive);
- if (hasBaseInHeader && (str.contains(QStringLiteral("href=\"/"), Qt::CaseInsensitive)
- || str.contains(QStringLiteral("<img src=\"/"), Qt::CaseInsensitive))) {
+ if (hasBaseInHeader && (str.contains(QLatin1String("href=\"/"), Qt::CaseInsensitive)
+ || str.contains(QLatin1String("<img src=\"/"), Qt::CaseInsensitive))) {
return true;
}
int httpPos = str.indexOf(QLatin1String("\"http:"), Qt::CaseInsensitive);
diff --git a/messageviewer/src/scamdetection/scamdetectionwebengine.cpp b/messageviewer/src/scamdetection/scamdetectionwebengine.cpp
index 9869c31..7330eae 100644
--- a/messageviewer/src/scamdetection/scamdetectionwebengine.cpp
+++ b/messageviewer/src/scamdetection/scamdetectionwebengine.cpp
@@ -141,7 +141,7 @@ void ScamDetectionWebEngine::handleScanPage(const QVariant &result)
if (!foundScam) {
//2) detect if url href has ip and not server name.
const QString hostname = url.host();
- if (hostname.contains(ip4regExp) && !hostname.contains(QStringLiteral("127.0.0.1"))) { //hostname
+ if (hostname.contains(ip4regExp) && !hostname.contains(QLatin1String("127.0.0.1"))) { //hostname
d->mDetails += QLatin1String("<li>") + i18n(
"This email contains a link which points to a numerical IP address (%1) instead of a typical textual website address. This is often the case in scam emails.",
addWarningColor(hostname)) + QLatin1String("</li>");
@@ -151,14 +151,14 @@ void ScamDetectionWebEngine::handleScanPage(const QVariant &result)
"This email contains a link which points to a hexadecimal IP address (%1) instead of a typical textual website address. This is often the case in scam emails.",
addWarningColor(hostname)) + QLatin1String("</li>");
foundScam = true;
- } else if (url.toString().contains(QStringLiteral("url?q="))) { //4) redirect url.
+ } else if (url.toString().contains(QLatin1String("url?q="))) { //4) redirect url.
d->mDetails += QLatin1String("<li>") + i18n(
"This email contains a link (%1) which has a redirection",
addWarningColor(url.toString())) + QLatin1String("</li>");
foundScam = true;
} else if ((url.toString().count(QStringLiteral("http://")) > 1)
|| (url.toString().count(QStringLiteral("https://")) > 1)) { //5) more that 1 http in url.
- if (!url.toString().contains(QStringLiteral("kmail:showAuditLog"))) {
+ if (!url.toString().contains(QLatin1String("kmail:showAuditLog"))) {
d->mDetails += QLatin1String("<li>") + i18n(
"This email contains a link (%1) which contains multiple http://. This is often the case in scam emails.",
addWarningColor(url.toString())) + QLatin1String("</li>");
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index 2d4a814..8f0398e 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -619,9 +619,9 @@ void ViewerPrivate::showAttachmentPopup(KMime::Content *node, const QString &nam
if ((contentTypeStr == QLatin1String("text/plain"))
|| (contentTypeStr == QLatin1String("image/png"))
|| (contentTypeStr == QLatin1String("image/jpeg"))
- || parentMimeType.contains(QStringLiteral("text/plain"))
- || parentMimeType.contains(QStringLiteral("image/png"))
- || parentMimeType.contains(QStringLiteral("image/jpeg"))
+ || parentMimeType.contains(QLatin1String("text/plain"))
+ || parentMimeType.contains(QLatin1String("image/png"))
+ || parentMimeType.contains(QLatin1String("image/jpeg"))
) {
action = menu.addAction(i18nc("to view something", "View"));
action->setEnabled(!deletedAttachment);
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index ac15ac4..eafaf7f 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -104,7 +104,7 @@ bool ViewerPluginManagerPrivate::initializePluginList()
plugins
+= KPluginLoader::findPlugins(QStringLiteral("messageviewer"), [](
const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("MessageViewer/ViewerCommonPlugin"));
+ return md.serviceTypes().contains(QLatin1String("MessageViewer/ViewerCommonPlugin"));
});
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(
diff --git a/mimetreeparser/src/bodyformatter/mailman.cpp b/mimetreeparser/src/bodyformatter/mailman.cpp
index 0ef3b7b..affff51 100644
--- a/mimetreeparser/src/bodyformatter/mailman.cpp
+++ b/mimetreeparser/src/bodyformatter/mailman.cpp
@@ -49,7 +49,7 @@ bool MailmanBodyPartFormatter::isMailmanMessage(KMime::Content *curNode) const
return true;
}
if (KMime::Headers::Base *header = curNode->headerByType("X-Mailer")) {
- if (header->asUnicodeString().contains(QStringLiteral("MAILMAN"), Qt::CaseInsensitive)) {
+ if (header->asUnicodeString().contains(QLatin1String("MAILMAN"), Qt::CaseInsensitive)) {
return true;
}
}
diff --git a/mimetreeparser/src/nodehelper.cpp b/mimetreeparser/src/nodehelper.cpp
index 52f1d1f..a6f459c 100644
--- a/mimetreeparser/src/nodehelper.cpp
+++ b/mimetreeparser/src/nodehelper.cpp
@@ -756,7 +756,7 @@ QString NodeHelper::fixEncoding(const QString &encoding)
// According to http://www.iana.org/assignments/character-sets, uppercase is
// preferred in MIME headers
const QString returnEncodingToUpper = returnEncoding.toUpper();
- if (returnEncodingToUpper.contains(QStringLiteral("ISO "))) {
+ if (returnEncodingToUpper.contains(QLatin1String("ISO "))) {
returnEncoding = returnEncodingToUpper;
returnEncoding.replace(QLatin1String("ISO "), QStringLiteral("ISO-"));
}
diff --git a/templateparser/src/templatesconfiguration.cpp b/templateparser/src/templatesconfiguration.cpp
index 14e944a..2157aa9 100644
--- a/templateparser/src/templatesconfiguration.cpp
+++ b/templateparser/src/templatesconfiguration.cpp
@@ -382,8 +382,8 @@ void TemplatesConfiguration::slotInsertCommand(const QString &cmd, int adjustCur
// qCDebug(TEMPLATEPARSER_LOG) << "Insert command:" << cmd;
const QString editText(edit->toPlainText());
- if ((editText.contains(QStringLiteral("%FORCEDPLAIN")) && (cmd == QLatin1String("%FORCEDHTML")))
- || (editText.contains(QStringLiteral("%FORCEDHTML")) && (cmd == QLatin1String("%FORCEDPLAIN")))) {
+ if ((editText.contains(QLatin1String("%FORCEDPLAIN")) && (cmd == QLatin1String("%FORCEDHTML")))
+ || (editText.contains(QLatin1String("%FORCEDHTML")) && (cmd == QLatin1String("%FORCEDPLAIN")))) {
KMessageBox::error(
this,
i18n("Use of \"Reply using plain text\" and \"Reply using HTML text\" in pairs"
diff --git a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
index d2db0ef..e119ead 100644
--- a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
+++ b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
@@ -91,7 +91,7 @@ QVector<PimCommon::PluginUtilData> NetworkUrlInterceptorPluginManagerPrivate::pl
void NetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("webengineviewer"), [](const KPluginMetaData &md) {
- return md.serviceTypes().contains(QStringLiteral("WebEngineViewer/UrlInterceptor"));
+ return md.serviceTypes().contains(QLatin1String("WebEngineViewer/UrlInterceptor"));
});
QVectorIterator<KPluginMetaData> i(plugins);