summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2022-02-02 15:18:06 +0100
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2022-02-04 03:49:13 +0100
commit995af22571f198da01f51ea4238c93cfc9da9da8 (patch)
treeb6ede42bb1ed84e0df602a67ef92c5bca2e47367
parent95b919339b660503ea4f7a080f7b9c8085e83ce6 (diff)
QUrl: Use Q_REMOVED_SINCE instead of explicit version checks
Use Q_REMOVED_SINCE macro for fromAce()/toAce() API changes. Change-Id: I057c6d648c2141929f04e4b4c4a38ba3275261ab Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (adapted from commit 58c48b40d1142d2646bb0fd0d4234dee65498c3d) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/compat/removed_api.cpp12
-rw-r--r--src/corelib/io/qurl.cpp22
-rw-r--r--src/corelib/io/qurl.h9
3 files changed, 15 insertions, 28 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index 630cbd5451..7e9f4f7445 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -153,6 +153,18 @@ int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
return QOperatingSystemVersionBase::compare(v1, v2);
}
+#include "qurl.h"
+
+QString QUrl::fromAce(const QByteArray &domain)
+{
+ return fromAce(domain, {});
+}
+
+QByteArray QUrl::toAce(const QString &domain)
+{
+ return toAce(domain, {});
+}
+
// #include <qotherheader.h>
// // implement removed functions from qotherheader.h
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 1e74b2ad9f..bbf557a0fb 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3060,17 +3060,6 @@ QString QUrl::fromAce(const QByteArray &domain, QUrl::AceProcessingOptions optio
ForbidLeadingDot /*FIXME: make configurable*/, options);
}
-#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
-/*!
- \since 4.2
- \overload
-*/
-QString QUrl::fromAce(const QByteArray &domain)
-{
- return fromAce(domain, {});
-}
-#endif
-
/*!
\since 6.3
@@ -3094,17 +3083,6 @@ QByteArray QUrl::toAce(const QString &domain, AceProcessingOptions options)
.toLatin1();
}
-#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
-/*!
- \since 4.2
- \overload
-*/
-QByteArray QUrl::toAce(const QString &domain)
-{
- return toAce(domain, {});
-}
-#endif
-
/*!
\internal
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 3001904ef3..e226462289 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -287,15 +287,12 @@ public:
};
Q_DECLARE_FLAGS(AceProcessingOptions, AceProcessingOption)
-#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
- static QString fromAce(const QByteArray &, AceProcessingOptions options = {});
- static QByteArray toAce(const QString &, AceProcessingOptions options = {});
-#else
+#if QT_REMOVED_SINCE(6, 3)
static QString fromAce(const QByteArray &);
static QByteArray toAce(const QString &);
- static QString fromAce(const QByteArray &, AceProcessingOptions options);
- static QByteArray toAce(const QString &, AceProcessingOptions options);
#endif
+ static QString fromAce(const QByteArray &domain, AceProcessingOptions options = {});
+ static QByteArray toAce(const QString &domain, AceProcessingOptions options = {});
static QStringList idnWhitelist();
static QStringList toStringList(const QList<QUrl> &uris, FormattingOptions options = FormattingOptions(PrettyDecoded));