diff options
author | Martin Smith <msmith@trolltech.com> | 2010-01-11 12:45:23 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-01-11 12:45:23 (GMT) |
commit | e1e67e84b223b36a01d767c163de730702057eb8 (patch) | |
tree | 984b4484c6995be30c1c48eb7a92278f247f067c /src/corelib/io/qurl.cpp | |
parent | 8e2c575f6383a69e9c1d4f069e3c8e3b219197b5 (diff) | |
parent | 039387d498f4ca0125938c7c79c5aff29dab5361 (diff) | |
download | Qt-e1e67e84b223b36a01d767c163de730702057eb8.zip Qt-e1e67e84b223b36a01d767c163de730702057eb8.tar.gz Qt-e1e67e84b223b36a01d767c163de730702057eb8.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r-- | src/corelib/io/qurl.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 1ba5e3f..74e5f74 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -350,8 +350,8 @@ public: }; int stateFlags; - QByteArray encodedNormalized; - const QByteArray & normalized(); + mutable QByteArray encodedNormalized; + const QByteArray & normalized() const; mutable QUrlErrorInfo errorInfo; QString createErrorString(); @@ -3850,6 +3850,9 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const if (!QURL_HASFLAG(stateFlags, Parsed)) parse(); else ensureEncodedParts(); + if (options==0x100) // private - see qHash(QUrl) + return normalized(); + QByteArray url; if (!(options & QUrl::RemoveScheme) && !scheme.isEmpty()) { @@ -3920,12 +3923,13 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const #define qToLower(ch) (((ch|32) >= 'a' && (ch|32) <= 'z') ? (ch|32) : ch) -const QByteArray &QUrlPrivate::normalized() +const QByteArray &QUrlPrivate::normalized() const { if (QURL_HASFLAG(stateFlags, QUrlPrivate::Normalized)) return encodedNormalized; - QURL_SETFLAG(stateFlags, QUrlPrivate::Normalized); + QUrlPrivate *that = const_cast<QUrlPrivate *>(this); + QURL_SETFLAG(that->stateFlags, QUrlPrivate::Normalized); QUrlPrivate tmp = *this; tmp.scheme = tmp.scheme.toLower(); |