summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2017-12-27 13:57:26 +0100
committerLaurent Montel <[email protected]>2017-12-27 13:57:40 +0100
commitabe8495b24cb4c649c3ed32c9cffbacf18b82bbe (patch)
tree2c36c72a604356ed336bd7be8ce0d318b45d93fe
parent0d63544e303f35631a5f71b4270bd5ac86f47d00 (diff)
Use QLatin1String
-rw-r--r--src/filter/filterimporter/filterimporterbalsa.cpp12
-rw-r--r--src/filter/filterimporter/filterimporterclawsmail.cpp8
-rw-r--r--src/filter/filterimporter/filterimporterprocmail.cpp12
-rw-r--r--src/filter/filterimporter/filterimporterthunderbird.cpp22
-rw-r--r--src/folder/accountconfigorderdialog.cpp6
5 files changed, 30 insertions, 30 deletions
diff --git a/src/filter/filterimporter/filterimporterbalsa.cpp b/src/filter/filterimporter/filterimporterbalsa.cpp
index d1a991c..21de68a 100644
--- a/src/filter/filterimporter/filterimporterbalsa.cpp
+++ b/src/filter/filterimporter/filterimporterbalsa.cpp
@@ -88,10 +88,10 @@ void FilterImporterBalsa::parseFilter(const KConfigGroup &grp)
void FilterImporterBalsa::parseCondition(const QString &condition, MailCommon::MailFilter *filter)
{
QStringList conditionList;
- if (condition.startsWith(QStringLiteral("OR "))) {
+ if (condition.startsWith(QLatin1String("OR "))) {
conditionList = condition.split(QStringLiteral("OR"));
filter->pattern()->setOp(SearchPattern::OpOr);
- } else if (condition.startsWith(QStringLiteral("AND "))) {
+ } else if (condition.startsWith(QLatin1String("AND "))) {
conditionList = condition.split(QStringLiteral("AND"));
filter->pattern()->setOp(SearchPattern::OpAnd);
} else {
@@ -100,7 +100,7 @@ void FilterImporterBalsa::parseCondition(const QString &condition, MailCommon::M
}
for (QString cond : qAsConst(conditionList)) {
cond = cond.trimmed();
- if (cond.startsWith(QStringLiteral("NOT"))) {
+ if (cond.startsWith(QLatin1String("NOT"))) {
cond = cond.right(cond.length() - 3);
cond = cond.trimmed();
}
@@ -108,15 +108,15 @@ void FilterImporterBalsa::parseCondition(const QString &condition, MailCommon::M
//Date between
QByteArray fieldName;
- if (cond.startsWith(QStringLiteral("DATE"))) {
+ if (cond.startsWith(QLatin1String("DATE"))) {
fieldName = "<date>";
cond = cond.right(cond.length() - 4);
cond = cond.trimmed();
QStringList splitDate = cond.split(QLatin1Char(' '));
qCDebug(MAILCOMMON_LOG) << " splitDate " << splitDate;
- } else if (cond.startsWith(QStringLiteral("FLAG"))) {
+ } else if (cond.startsWith(QLatin1String("FLAG"))) {
qCDebug(MAILCOMMON_LOG) << " FLAG :";
- } else if (cond.startsWith(QStringLiteral("STRING"))) {
+ } else if (cond.startsWith(QLatin1String("STRING"))) {
qCDebug(MAILCOMMON_LOG) << " STRING";
} else {
qCDebug(MAILCOMMON_LOG) << " condition not implemented :" << cond;
diff --git a/src/filter/filterimporter/filterimporterclawsmail.cpp b/src/filter/filterimporter/filterimporterclawsmail.cpp
index 9f02a72..5870c27 100644
--- a/src/filter/filterimporter/filterimporterclawsmail.cpp
+++ b/src/filter/filterimporter/filterimporterclawsmail.cpp
@@ -77,13 +77,13 @@ MailFilter *FilterImporterClawsMails::parseLine(const QString &line)
MailFilter *filter = new MailFilter();
QString tmp = line;
//Enabled ?
- if (tmp.startsWith(QStringLiteral("enabled"))) {
+ if (tmp.startsWith(QLatin1String("enabled"))) {
filter->setEnabled(true);
tmp.remove(QStringLiteral("enabled "));
}
//Filter name
- if (tmp.startsWith(QStringLiteral("rulename"))) {
+ if (tmp.startsWith(QLatin1String("rulename"))) {
tmp.remove(QStringLiteral("rulename "));
int pos;
const QString name = extractString(tmp, pos);
@@ -111,9 +111,9 @@ QString FilterImporterClawsMails::extractConditions(const QString &line, MailFil
{
QByteArray fieldName;
//Action
- if (line.startsWith(QStringLiteral("subject"))) {
+ if (line.startsWith(QLatin1String("subject"))) {
fieldName = "subject";
- } else if (line.startsWith(QStringLiteral("age_lower"))) {
+ } else if (line.startsWith(QLatin1String("age_lower"))) {
}
filter->pattern()->setOp(SearchPattern::OpAnd);
//TODO
diff --git a/src/filter/filterimporter/filterimporterprocmail.cpp b/src/filter/filterimporter/filterimporterprocmail.cpp
index d4ed859..7eab0e2 100644
--- a/src/filter/filterimporter/filterimporterprocmail.cpp
+++ b/src/filter/filterimporter/filterimporterprocmail.cpp
@@ -77,25 +77,25 @@ MailCommon::MailFilter *FilterImporterProcmail::parseLine(QTextStream &stream, Q
} else if (line.startsWith(QLatin1Char('#'))) {
//Commented line
return filter;
- } else if (line.startsWith(QStringLiteral(":0"))) {
+ } else if (line.startsWith(QLatin1String(":0"))) {
appendFilter(filter);
filter = new MailFilter();
const QString uniqName = createUniqFilterName();
filter->pattern()->setName(uniqName);
filter->setToolbarName(uniqName);
- } else if (line.startsWith(QStringLiteral("* "))) {
+ } else if (line.startsWith(QLatin1String("* "))) {
line.remove(0, 2);
QByteArray fieldName;
SearchRule::Function functionName = SearchRule::FuncRegExp;
- if (line.startsWith(QStringLiteral("^From:"))) {
+ if (line.startsWith(QLatin1String("^From:"))) {
line.remove(QStringLiteral("^From:"));
fieldName = "from";
- } else if (line.startsWith(QStringLiteral("^Subject:"))) {
+ } else if (line.startsWith(QLatin1String("^Subject:"))) {
line.remove(QStringLiteral("^Subject:"));
fieldName = "subject";
- } else if (line.startsWith(QStringLiteral("^Sender:"))) {
+ } else if (line.startsWith(QLatin1String("^Sender:"))) {
line.remove(QStringLiteral("^Sender:"));
- } else if (line.startsWith(QStringLiteral("^(To|Cc):"))) {
+ } else if (line.startsWith(QLatin1String("^(To|Cc):"))) {
line.remove(QStringLiteral("^(To|Cc):"));
fieldName = "<recipients>";
} else {
diff --git a/src/filter/filterimporter/filterimporterthunderbird.cpp b/src/filter/filterimporter/filterimporterthunderbird.cpp
index e025fb2..b576b4b 100644
--- a/src/filter/filterimporter/filterimporterthunderbird.cpp
+++ b/src/filter/filterimporter/filterimporterthunderbird.cpp
@@ -74,19 +74,19 @@ QString FilterImporterThunderbird::defaultThunderbirdFiltersSettingsPath()
MailCommon::MailFilter *FilterImporterThunderbird::parseLine(QTextStream &stream, QString line, MailCommon::MailFilter *filter)
{
- if (line.startsWith(QStringLiteral("name="))) {
+ if (line.startsWith(QLatin1String("name="))) {
appendFilter(filter);
filter = new MailFilter();
line = cleanArgument(line, QStringLiteral("name="));
filter->pattern()->setName(line);
filter->setToolbarName(line);
- } else if (line.startsWith(QStringLiteral("action="))) {
+ } else if (line.startsWith(QLatin1String("action="))) {
line = cleanArgument(line, QStringLiteral("action="));
QString value;
QString actionName = extractActions(line, filter, value);
if (!stream.atEnd()) {
line = stream.readLine();
- if (line.startsWith(QStringLiteral("actionValue="))) {
+ if (line.startsWith(QLatin1String("actionValue="))) {
value = cleanArgument(line, QStringLiteral("actionValue="));
//change priority
if (actionName == QLatin1String("Change priority")) {
@@ -124,23 +124,23 @@ MailCommon::MailFilter *FilterImporterThunderbird::parseLine(QTextStream &stream
} else {
createFilterAction(filter, actionName, value);
}
- } else if (line.startsWith(QStringLiteral("enabled="))) {
+ } else if (line.startsWith(QLatin1String("enabled="))) {
line = cleanArgument(line, QStringLiteral("enabled="));
if (line == QLatin1String("no")) {
filter->setEnabled(false);
}
- } else if (line.startsWith(QStringLiteral("condition="))) {
+ } else if (line.startsWith(QLatin1String("condition="))) {
line = cleanArgument(line, QStringLiteral("condition="));
extractConditions(line, filter);
- } else if (line.startsWith(QStringLiteral("type="))) {
+ } else if (line.startsWith(QLatin1String("type="))) {
line = cleanArgument(line, QStringLiteral("type="));
extractType(line, filter);
- } else if (line.startsWith(QStringLiteral("version="))) {
+ } else if (line.startsWith(QLatin1String("version="))) {
line = cleanArgument(line, QStringLiteral("version="));
if (line.toInt() != 9) {
qCDebug(MAILCOMMON_LOG) << " thunderbird filter version different of 9 need to look at if it changed";
}
- } else if (line.startsWith(QStringLiteral("logging="))) {
+ } else if (line.startsWith(QLatin1String("logging="))) {
line = cleanArgument(line, QStringLiteral("logging="));
if (line == QLatin1String("no")) {
//TODO
@@ -157,7 +157,7 @@ MailCommon::MailFilter *FilterImporterThunderbird::parseLine(QTextStream &stream
void FilterImporterThunderbird::extractConditions(const QString &line, MailCommon::MailFilter *filter)
{
- if (line.startsWith(QStringLiteral("AND"))) {
+ if (line.startsWith(QLatin1String("AND"))) {
filter->pattern()->setOp(SearchPattern::OpAnd);
const QStringList conditionsList = line.split(QStringLiteral("AND "));
const int numberOfCond(conditionsList.count());
@@ -166,7 +166,7 @@ void FilterImporterThunderbird::extractConditions(const QString &line, MailCommo
splitConditions(conditionsList.at(i), filter);
}
}
- } else if (line.startsWith(QStringLiteral("OR"))) {
+ } else if (line.startsWith(QLatin1String("OR"))) {
filter->pattern()->setOp(SearchPattern::OpOr);
const QStringList conditionsList = line.split(QStringLiteral("OR "));
const int numberOfCond(conditionsList.count());
@@ -175,7 +175,7 @@ void FilterImporterThunderbird::extractConditions(const QString &line, MailCommo
splitConditions(conditionsList.at(i), filter);
}
}
- } else if (line.startsWith(QStringLiteral("ALL"))) {
+ } else if (line.startsWith(QLatin1String("ALL"))) {
filter->pattern()->setOp(SearchPattern::OpAll);
} else {
qCDebug(MAILCOMMON_LOG) << " missing extract condition" << line;
diff --git a/src/folder/accountconfigorderdialog.cpp b/src/folder/accountconfigorderdialog.cpp
index 2d6dc2b..27e946a 100644
--- a/src/folder/accountconfigorderdialog.cpp
+++ b/src/folder/accountconfigorderdialog.cpp
@@ -206,11 +206,11 @@ void AccountConfigOrderDialog::init()
instanceStruct.name = instance.name();
if (PimCommon::Util::isImapResource(identifier)) {
instanceStruct.name += QLatin1String(" (IMAP)");
- } else if (identifier.startsWith(QStringLiteral("akonadi_maildir_resource"))) {
+ } else if (identifier.startsWith(QLatin1String("akonadi_maildir_resource"))) {
instanceStruct.name += QLatin1String(" (Maildir)");
- } else if (identifier.startsWith(QStringLiteral("akonadi_mailbox_resource"))) {
+ } else if (identifier.startsWith(QLatin1String("akonadi_mailbox_resource"))) {
instanceStruct.name += QLatin1String(" (Mailbox)");
- } else if (identifier.startsWith(QStringLiteral("akonadi_mixedmaildir_resource"))) {
+ } else if (identifier.startsWith(QLatin1String("akonadi_mixedmaildir_resource"))) {
instanceStruct.name += QLatin1String(" (Mixedmaildir)");
} else {
qCDebug(MAILCOMMON_LOG) << " Unknown resource type " << identifier;