summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <dangelog@gmail.com>2012-04-04 20:19:39 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-08 18:25:04 +0200
commit9166163f103b8ac35544270c8cf397de3416b8f0 (patch)
treec2a6434522785bc1779182dbf77e75b5f19bf1c0 /src/corelib/io
parentc3b9a67cf054c71d7dd57d91220cded62256019d (diff)
QUrl: added two-arguments qHash support
An unnecessary #include <QHash> was also removed, and other includes refactored. Change-Id: Ifcd3e37d75029c142a2e55ab492b88624505670a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-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;