Commit 91d54237 authored by Laurent Montel's avatar Laurent Montel 😁

Use QLAtin1String

parent be5c1b68
......@@ -418,11 +418,11 @@ bool MailFilter::readConfig(const KConfigGroup &config, bool interactive)
bApplyOnAllFolders = false;
mApplicability = ButImap;
} else {
bApplyBeforeOutbound = bool(sets.contains(QStringLiteral("before-send-mail")));
bApplyOnInbound = bool(sets.contains(QStringLiteral("check-mail")));
bApplyOnOutbound = bool(sets.contains(QStringLiteral("send-mail")));
bApplyOnExplicit = bool(sets.contains(QStringLiteral("manual-filtering")));
bApplyOnAllFolders = bool(sets.contains(QStringLiteral("all-folders")));
bApplyBeforeOutbound = bool(sets.contains(QLatin1String("before-send-mail")));
bApplyOnInbound = bool(sets.contains(QLatin1String("check-mail")));
bApplyOnOutbound = bool(sets.contains(QLatin1String("send-mail")));
bApplyOnExplicit = bool(sets.contains(QLatin1String("manual-filtering")));
bApplyOnAllFolders = bool(sets.contains(QLatin1String("all-folders")));
mApplicability = (AccountType)config.readEntry(
"Applicability", (int)ButImap);
}
......
......@@ -196,9 +196,9 @@ void AccountConfigOrderDialog::init()
for (const Akonadi::AgentInstance &instance : lstInstances) {
const QStringList capabilities(instance.type().capabilities());
if (instance.type().mimeTypes().contains(KMime::Message::mimeType())) {
if (capabilities.contains(QStringLiteral("Resource"))
&& !capabilities.contains(QStringLiteral("Virtual"))
&& !capabilities.contains(QStringLiteral("MailTransport"))) {
if (capabilities.contains(QLatin1String("Resource"))
&& !capabilities.contains(QLatin1String("Virtual"))
&& !capabilities.contains(QLatin1String("MailTransport"))) {
const QString identifier = instance.identifier();
if (!identifier.contains(POP3_RESOURCE_IDENTIFIER)) {
instanceList << instance.identifier();
......
......@@ -321,7 +321,7 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
//TODO ?
code += i18n("<message> not implemented/supported");
} else if (mField == "<body>") {
if (!requires.contains(QStringLiteral("body"))) {
if (!requires.contains(QLatin1String("body"))) {
requires << QStringLiteral("body");
}
QString comparaison;
......@@ -345,12 +345,12 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncRegExp:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
break;
case FuncNotRegExp:
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -358,14 +358,14 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncStartWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
contentStr = QLatin1Char('^') + contentStr;
break;
case FuncNotStartWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -374,7 +374,7 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncEndWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -382,7 +382,7 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncNotEndWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -425,12 +425,12 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncRegExp:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
break;
case FuncNotRegExp:
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -438,14 +438,14 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncStartWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
contentStr = QLatin1Char('^') + contentStr;
break;
case FuncNotStartWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -454,7 +454,7 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncEndWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......@@ -462,7 +462,7 @@ void SearchRule::generateSieveScript(QStringList &requires, QString &code)
break;
case FuncNotEndWith:
comparaison = QStringLiteral(":regex");
if (!requires.contains(QStringLiteral("regex"))) {
if (!requires.contains(QLatin1String("regex"))) {
requires << QStringLiteral("regex");
}
comparaison = QStringLiteral(":regex");
......
......@@ -97,7 +97,7 @@ bool MailCommon::Util::isVirtualCollection(const QString &resource)
}
const auto type = Akonadi::AgentManager::self()->type(resource);
return type.capabilities().contains(QStringLiteral("Virtual"));
return type.capabilities().contains(QLatin1String("Virtual"));
}
bool MailCommon::Util::isLocalCollection(const QString &resource)
......@@ -155,9 +155,9 @@ Akonadi::AgentInstance::List MailCommon::Util::agentInstances(bool excludeMailDi
for (const Akonadi::AgentInstance &instance : agentList) {
const QStringList capabilities(instance.type().capabilities());
if (instance.type().mimeTypes().contains(KMime::Message::mimeType())) {
if (capabilities.contains(QStringLiteral("Resource"))
&& !capabilities.contains(QStringLiteral("Virtual"))
&& !capabilities.contains(QStringLiteral("MailTransport"))) {
if (capabilities.contains(QLatin1String("Resource"))
&& !capabilities.contains(QLatin1String("Virtual"))
&& !capabilities.contains(QLatin1String("MailTransport"))) {
relevantInstances << instance;
} else if (!excludeMailDispacher
&& instance.identifier() == QLatin1String("akonadi_maildispatcher_agent")) {
......
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