Commit abbf9efb authored by Laurent Montel's avatar Laurent Montel 😁

Use contains here

parent 1b6ef71b
...@@ -36,11 +36,11 @@ QString KPIM::AddresseeLineEditUtil::adaptPasteMails(QString str) ...@@ -36,11 +36,11 @@ QString KPIM::AddresseeLineEditUtil::adaptPasteMails(QString str)
if (newText.startsWith(QStringLiteral("mailto:"))) { if (newText.startsWith(QStringLiteral("mailto:"))) {
const QUrl url(newText); const QUrl url(newText);
newText = url.path(); newText = url.path();
} else if (newText.indexOf(QStringLiteral(" at ")) != -1) { } else if (newText.contains(QStringLiteral(" at "))) {
// Anti-spam stuff // Anti-spam stuff
newText.replace(QStringLiteral(" at "), QStringLiteral("@")); newText.replace(QStringLiteral(" at "), QStringLiteral("@"));
newText.replace(QStringLiteral(" dot "), QStringLiteral(".")); newText.replace(QStringLiteral(" dot "), QStringLiteral("."));
} else if (newText.indexOf(QStringLiteral("(at)")) != -1) { } else if (newText.contains(QStringLiteral("(at)"))) {
newText.replace(QRegularExpression(QStringLiteral("\\s*\\(at\\)\\s*")), QStringLiteral("@")); newText.replace(QRegularExpression(QStringLiteral("\\s*\\(at\\)\\s*")), QStringLiteral("@"));
} }
return newText; return newText;
......
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