Commit 14569fb4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

QString::split(..., Qt::SplitBehavior, ...) is already in Qt 5.14

parent 5f041370
Pipeline #47722 passed with stage
in 10 minutes and 43 seconds
......@@ -353,31 +353,19 @@ bool ServerTestPrivate::handleNntpConversation(MailTransport::Socket *socket, in
// SASL DIGEST-MD5 CRAM-MD5 NTLM PLAIN LOGIN
// STARTTLS
// .
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QVector<QStringRef> lines = response.splitRef(QStringLiteral("\r\n"), QString::SkipEmptyParts);
#else
const QVector<QStringRef> lines = response.splitRef(QStringLiteral("\r\n"), Qt::SkipEmptyParts);
#endif
for (const QStringRef &line : lines) {
if (line.compare(QLatin1String("STARTTLS"), Qt::CaseInsensitive) == 0) {
*shouldStartTLS = true;
} else if (line.startsWith(QLatin1String("AUTHINFO "), Qt::CaseInsensitive)) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QVector<QStringRef> authinfos = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
const QVector<QStringRef> authinfos = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
const QString s(QStringLiteral("USER"));
const QStringRef ref(&s);
if (authinfos.contains(ref)) {
authenticationResults[type].append(Transport::EnumAuthenticationType::CLEAR); // XXX
}
} else if (line.startsWith(QLatin1String("SASL "), Qt::CaseInsensitive)) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList auths = line.mid(5).toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
const QStringList auths = line.mid(5).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
authenticationResults[type] += parseAuthenticationList(auths);
} else if (line == QLatin1Char('.')) {
return false;
......
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