diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-03-29 17:32:58 -0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-30 01:19:59 +0200 |
commit | ffd20af339c64bf3af7983d20b029724a67f0734 (patch) | |
tree | 94feb987c82005ee40b307aa20111ec095740011 /src | |
parent | 7f20dce264c6f982e84c3b5d60f3ffbf6341c908 (diff) |
Revert to Qt4 behaviour that QUrl().isValid() == false
There are probably lots of places that rely on that behaviour, so go
back to what it was.
Change-Id: I4d1503a0ee105a50cdfaab52d9a5862a02c70757
Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qurl.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 8675d03d85..634a613ade 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -1379,7 +1379,7 @@ QUrl::~QUrl() } /*! - Returns true if the URL is valid; otherwise returns false. + Returns true if the URL is non-empty and valid; otherwise returns false. The URL is run through a conformance test. Every part of the URL must conform to the standard encoding rules of the URI standard @@ -1389,7 +1389,7 @@ QUrl::~QUrl() */ bool QUrl::isValid() const { - if (!d) return true; + if (isEmpty()) return false; return d->sectionHasError == 0; } @@ -1399,17 +1399,7 @@ bool QUrl::isValid() const bool QUrl::isEmpty() const { if (!d) return true; - - // cannot use sectionIsPresent here - // we may have only empty sections present - return d->scheme.isEmpty() - && d->userName.isEmpty() - && d->password.isEmpty() - && d->host.isEmpty() - && d->port == -1 - && d->path.isEmpty() - && d->query.isEmpty() - && d->fragment.isEmpty(); + return d->isEmpty(); } /*! |