From 729b2dfa31c7585028599ca66644fa7270c217e9 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 17 Mar 2021 19:27:17 +0100 Subject: Require Qt 5.9 and clean up compatibility code --- src/base/QXmppSasl.cpp | 10 ---------- src/base/QXmppUtils.cpp | 4 ---- 2 files changed, 14 deletions(-) (limited to 'src/base') diff --git a/src/base/QXmppSasl.cpp b/src/base/QXmppSasl.cpp index 85edca5e..f7d25130 100644 --- a/src/base/QXmppSasl.cpp +++ b/src/base/QXmppSasl.cpp @@ -34,10 +34,6 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 2) -#define QT_HAS_SHA3_SUPPORT -#endif - const char *ns_xmpp_sasl = "urn:ietf:params:xml:ns:xmpp-sasl"; static QByteArray forcedNonce; @@ -47,9 +43,7 @@ static const QMap SCRAM_ALGORITHMS = { { QStringLiteral("SCRAM-SHA-1"), QCryptographicHash::Sha1 }, { QStringLiteral("SCRAM-SHA-256"), QCryptographicHash::Sha256 }, { QStringLiteral("SCRAM-SHA-512"), QCryptographicHash::Sha512 }, -#ifdef QT_HAS_SHA3_SUPPORT { QStringLiteral("SCRAM-SHA3-512"), QCryptographicHash::RealSha3_512 }, -#endif }; // Returns the hash length in bytes (QCH::hashLength() only exists since 5.12). @@ -64,9 +58,7 @@ int hashLength(QCryptographicHash::Algorithm algorithm) case QCryptographicHash::Sha256: return 256 / 8; case QCryptographicHash::Sha512: -#ifdef QT_HAS_SHA3_SUPPORT case QCryptographicHash::RealSha3_512: -#endif return 512 / 8; default: return QCryptographicHash::hash({}, algorithm).size(); @@ -309,9 +301,7 @@ QXmppSaslClient::~QXmppSaslClient() QStringList QXmppSaslClient::availableMechanisms() { return { -#ifdef QT_HAS_SHA3_SUPPORT QStringLiteral("SCRAM-SHA3-512"), -#endif QStringLiteral("SCRAM-SHA-512"), QStringLiteral("SCRAM-SHA-256"), QStringLiteral("SCRAM-SHA-1"), diff --git a/src/base/QXmppUtils.cpp b/src/base/QXmppUtils.cpp index 3a858a30..9fd46a71 100644 --- a/src/base/QXmppUtils.cpp +++ b/src/base/QXmppUtils.cpp @@ -127,11 +127,7 @@ QDateTime QXmppUtils::datetimeFromString(const QString &str) QString QXmppUtils::datetimeToString(const QDateTime &dt) { if (dt.time().msec()) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) return dt.toUTC().toString(Qt::ISODateWithMs); -#else - return dt.toUTC().toString("yyyy-MM-ddTHH:mm:ss.zzzZ"); -#endif } return dt.toUTC().toString(Qt::ISODate); } -- cgit v1.2.3