diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2010-01-12 18:10:12 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2010-01-13 09:06:20 (GMT) |
commit | b38da980696e69b61d2f5411ad2f2c36453ed089 (patch) | |
tree | 8a9e8160ea104ddd23706ea185e87320bb6f4708 /src/corelib | |
parent | 22796b38c3a7dbcdb540e4c58e645b0267fe360c (diff) | |
download | Qt-b38da980696e69b61d2f5411ad2f2c36453ed089.zip Qt-b38da980696e69b61d2f5411ad2f2c36453ed089.tar.gz Qt-b38da980696e69b61d2f5411ad2f2c36453ed089.tar.bz2 |
add a hash function to QUrl, and remove the xmlpatterns specific one
we had a hash function defined in xmlpatterns; this commit adds a global
hash function for QUrls.
Beware that code that defines its own hash function for QUrls will need
to #ifdef it out for 4.7.
Patch-By: Warwick Allison
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qurl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index f76d345..bb04ad1 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -46,6 +46,7 @@ #include <QtCore/qobjectdefs.h> #include <QtCore/qpair.h> #include <QtCore/qstring.h> +#include <QtCore/qhash.h> QT_BEGIN_HEADER @@ -75,6 +76,7 @@ public: RemovePath = 0x20, RemoveQuery = 0x40, RemoveFragment = 0x80, + // 0x100: private: normalized StripTrailingSlash = 0x10000 }; @@ -268,6 +270,11 @@ public: inline DataPtr &data_ptr() { return d; } }; +inline uint qHash(const QUrl &uri) +{ + return qHash(uri.toEncoded(QUrl::FormattingOption(0x100))); +} + Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrl) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) |