QUrl::setEncodedQueryItems should replace

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>
This commit is contained in:
Martin Petersson 2012-06-13 12:38:51 +02:00 committed by Qt by Nokia
parent c752bb8eb8
commit 79b14f42ba

View 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));