QUrl::topLevelDomain() - deprecate in 5.15

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 <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Timur Pocheptsov 2020-02-04 15:17:52 +01:00
parent a20dbcf7c7
commit c9b8ebc223
2 changed files with 8 additions and 3 deletions

View File

@ -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.

View File

@ -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;