From c9b8ebc2234027a11eae0dfc45c13d276dfc92a1 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 4 Feb 2020 15:17:52 +0100 Subject: [PATCH] QUrl::topLevelDomain() - deprecate in 5.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And remove in Qt 6 (with private API remaining). [ChangeLog][Deprecation Notice] QUrl::topLevelDomain() was deprecated in 5.15 and will be removed in 6.0 Task-number: QTBUG-80308 Change-Id: Ie053c9c8813274c971e2d6fc442dd6ce716fadf1 Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- src/corelib/io/qurl.cpp | 7 +++++-- src/corelib/io/qurl.h | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 659552b72f..def4a1095f 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -415,7 +415,7 @@ #include "qhash.h" #include "qdir.h" // for QDir::fromNativeSeparators #include "qdatastream.h" -#if QT_CONFIG(topleveldomain) +#if QT_CONFIG(topleveldomain) // ### Qt6: Remove section #include "qtldurl_p.h" #endif #include "private/qipaddress_p.h" @@ -3149,10 +3149,13 @@ bool QUrl::hasFragment() const return d->hasFragment(); } +#if QT_DEPRECATED_SINCE(5, 15) #if QT_CONFIG(topleveldomain) /*! \since 4.8 + \deprecated + Returns the TLD (Top-Level Domain) of the URL, (e.g. .co.uk, .net). Note that the return value is prefixed with a '.' unless the URL does not contain a valid TLD, in which case the function returns @@ -3185,7 +3188,7 @@ QString QUrl::topLevelDomain(ComponentFormattingOptions options) const return tld; } #endif - +#endif // QT_DEPRECATED_SINCE(5, 15) /*! Returns the result of the merge of this URL with \a relative. This URL is used as a base to convert \a relative to an absolute URL. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 94269e4369..eb7fb8087c 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -233,9 +233,11 @@ public: void setHost(const QString &host, ParsingMode mode = DecodedMode); QString host(ComponentFormattingOptions = FullyDecoded) const; +#if QT_DEPRECATED_SINCE(5, 15) #if QT_CONFIG(topleveldomain) - QString topLevelDomain(ComponentFormattingOptions options = FullyDecoded) const; + QT_DEPRECATED QString topLevelDomain(ComponentFormattingOptions options = FullyDecoded) const; #endif +#endif // QT_DEPRECATED_SINCE(5, 15) void setPort(int port); int port(int defaultPort = -1) const;