summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qtldurl.cpp1
-rw-r--r--src/corelib/io/qurl.cpp17
-rw-r--r--src/corelib/io/qurl.h6
3 files changed, 11 insertions, 13 deletions
diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp
index 7adb40261b..48df01b48c 100644
--- a/src/corelib/io/qtldurl.cpp
+++ b/src/corelib/io/qtldurl.cpp
@@ -44,6 +44,7 @@
#include "private/qurltlds_p.h"
#include "private/qtldurl_p.h"
#include "QtCore/qstringlist.h"
+#include "QtCore/qhash.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 9753474617..62ad732935 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -180,19 +180,13 @@
regardless of the Qt::FormattingOptions used.
*/
-/*!
- \fn uint qHash(const QUrl &url)
- \since 4.7
- \relates QUrl
-
- Computes a hash key from the normalized version of \a url.
- */
#include "qurl.h"
#include "qurl_p.h"
#include "qplatformdefs.h"
#include "qstring.h"
#include "qstringlist.h"
#include "qdebug.h"
+#include "qhash.h"
#include "qdir.h" // for QDir::fromNativeSeparators
#include "qtldurl_p.h"
#include "private/qipaddress_p.h"
@@ -2546,21 +2540,22 @@ QString QUrl::errorString() const
\internal
*/
-/*! \fn uint qHash(const QUrl &url)
+/*! \fn uint qHash(const QUrl &url, uint seed = 0)
\relates QHash
+ \since 5.0
Returns the hash value for the \a url.
*/
-uint qHash(const QUrl &url)
+uint qHash(const QUrl &url, uint seed)
{
if (!url.d)
- return qHash(-1); // the hash of an unset port (-1)
+ return qHash(-1, seed); // the hash of an unset port (-1)
return qHash(url.d->scheme) ^
qHash(url.d->userName) ^
qHash(url.d->password) ^
qHash(url.d->host) ^
- qHash(url.d->port) ^
+ qHash(url.d->port, seed) ^
qHash(url.d->path) ^
qHash(url.d->query) ^
qHash(url.d->fragment);
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 5fcbbf0c0c..068fe73401 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -46,7 +46,9 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
-#include <QtCore/qhash.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qpair.h>
+#include <QtCore/qglobal.h>
QT_BEGIN_HEADER
@@ -304,7 +306,7 @@ public:
static QByteArray toAce(const QString &);
static QStringList idnWhitelist();
static void setIdnWhitelist(const QStringList &);
- friend Q_CORE_EXPORT uint qHash(const QUrl &url);
+ friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0);
private:
QUrlPrivate *d;