summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r--src/corelib/io/qurl.cpp16
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();
}
/*!