summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-18 14:19:36 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-18 14:19:36 +0100
commit6aa09bbce59828d028f6d1e81d2bfc6ba537aae1 (patch)
tree9ba857247c0862fa6636766fad9cdab146c9c19b /src/corelib/io
parentf4044e853cdb66a7f7f7e61df78434243b85b03d (diff)
parent21fbca97a8ee284ff6ffaff64c180700cc5537ab (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I541bd3069df3ab54c7942d5f4a9e155e3b6566a0
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qurl.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index f17215964f..7018b333f2 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3542,9 +3542,13 @@ bool QUrl::operator ==(const QUrl &url) const
if (!url.d)
return d->isEmpty();
- // Compare which sections are present, but ignore Host
- // which is set by parsing but not by construction, when empty.
- const int mask = QUrlPrivate::FullUrl & ~QUrlPrivate::Host;
+ // First, compare which sections are present, since it speeds up the
+ // processing considerably. We just have to ignore the host-is-present flag
+ // for local files (the "file" protocol), due to the requirements of the
+ // XDG file URI specification.
+ int mask = QUrlPrivate::FullUrl;
+ if (isLocalFile())
+ mask &= ~QUrlPrivate::Host;
return (d->sectionIsPresent & mask) == (url.d->sectionIsPresent & mask) &&
d->scheme == url.d->scheme &&
d->userName == url.d->userName &&
@@ -3575,9 +3579,13 @@ bool QUrl::matches(const QUrl &url, FormattingOptions options) const
if (!url.d)
return d->isEmpty();
- // Compare which sections are present, but ignore Host
- // which is set by parsing but not by construction, when empty.
- int mask = QUrlPrivate::FullUrl & ~QUrlPrivate::Host;
+ // First, compare which sections are present, since it speeds up the
+ // processing considerably. We just have to ignore the host-is-present flag
+ // for local files (the "file" protocol), due to the requirements of the
+ // XDG file URI specification.
+ int mask = QUrlPrivate::FullUrl;
+ if (isLocalFile())
+ mask &= ~QUrlPrivate::Host;
if (options & QUrl::RemoveScheme)
mask &= ~QUrlPrivate::Scheme;