QUrl::setEncodedQueryItems should replace
authorMartin Petersson <Martin.Petersson@nokia.com>
Wed, 13 Jun 2012 10:38:51 +0000 (12:38 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 08:05:49 +0000 (10:05 +0200)
If there is  already a query string present in the url. It should be
replace when setEncodedQueryItems is called again.

Task-number: QTBUG-26148
Change-Id: I2bd4e1f5d9b4161d64556062e97141888ad89b3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/io/qurlquery.h

index 4b9d104..5939fd9 100644 (file)
@@ -145,7 +145,7 @@ inline void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
 
 inline void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &qry)
 {
-    QUrlQuery q(*this);
+    QUrlQuery q;
     QList<QPair<QByteArray, QByteArray> >::ConstIterator it = qry.constBegin();
     for ( ; it != qry.constEnd(); ++it)
         q.addQueryItem(QString::fromUtf8(it->first), QString::fromUtf8(it->second));