From 61598703487e893e5fae2030097bde941a6a3b54 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 25 Apr 2012 12:48:02 +0200 Subject: Revert QUrl::isRelative to its Qt 4 behaviour Instead of trying to return whether the URL is relative to something undefined, let's instead follow what the documentation was saying all along and what the RFC says about "Relative References". Change-Id: I32722321a6b36c6e3480669ad769390e4c6f7d1c Reviewed-by: Lars Knoll --- src/corelib/io/qurl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 5cc49c8192..44160b3d8b 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2076,14 +2076,16 @@ QUrl QUrl::resolved(const QUrl &relative) const } /*! - Returns true if the URL is relative; otherwise returns false. A - URL is relative if its scheme is undefined; this function is - therefore equivalent to calling scheme().isEmpty(). + Returns true if the URL is relative; otherwise returns false. A URL is + relative reference if its scheme is undefined; this function is therefore + equivalent to calling scheme().isEmpty(). + + Relative references are defined in RFC 3986 section 4.2. */ bool QUrl::isRelative() const { if (!d) return true; - return !d->hasScheme() && !d->path.startsWith(QLatin1Char('/')); + return !d->hasScheme(); } /*! -- cgit v1.2.3