Commit 85b2d540 authored by Ahmad Samir's avatar Ahmad Samir

Port QRegExp to QRegularExpression

And one other minor optimisation.
parent 74457920
Pipeline #29250 passed with stage
in 10 minutes and 23 seconds
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <QHash> #include <QHash>
#include <QHostInfo> #include <QHostInfo>
#include <QProgressBar> #include <QProgressBar>
#include <QRegularExpression>
#include <QTimer> #include <QTimer>
#include <QSet> #include <QSet>
...@@ -242,10 +243,9 @@ bool ServerTestPrivate::handlePopConversation(MailTransport::Socket *socket, int ...@@ -242,10 +243,9 @@ bool ServerTestPrivate::handlePopConversation(MailTransport::Socket *socket, int
// Initial Greeting // Initial Greeting
if (stage == 0) { if (stage == 0) {
//Regexp taken from POP3 ioslave //Regexp taken from POP3 ioslave
QString responseWithoutCRLF = response; const QString responseWithoutCRLF = response.chopped(2);
responseWithoutCRLF.chop(2); const QRegularExpression re(QStringLiteral("<[A-Za-z0-9\\.\\-_]+@[A-Za-z0-9\\.\\-_]+>$"),
QRegExp re(QStringLiteral("<[A-Za-z0-9\\.\\-_]+@[A-Za-z0-9\\.\\-_]+>$"), QRegularExpression::CaseInsensitiveOption);
Qt::CaseInsensitive);
if (responseWithoutCRLF.indexOf(re) != -1) { if (responseWithoutCRLF.indexOf(re) != -1) {
authenticationResults[type] << Transport::EnumAuthenticationType::APOP; authenticationResults[type] << Transport::EnumAuthenticationType::APOP;
} }
......
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