QNetworkCacheMetaData::AttributesMap is not a multi hash
And having duplicated entries in the hash doesn't make any sense. So use regular iteration and insert for streaming the data in and out. Change-Id: Ic3983010bdb9e17b207c6038fdccf43659da0e23 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>bb10
parent
0023948f83
commit
01a70da3e7
|
|
@ -331,11 +331,11 @@ QDataStream &operator<<(QDataStream &out, const QNetworkCacheMetaData &metaData)
|
|||
static inline QDataStream &operator<<(QDataStream &out, const QNetworkCacheMetaData::AttributesMap &hash)
|
||||
{
|
||||
out << quint32(hash.size());
|
||||
QNetworkCacheMetaData::AttributesMap::ConstIterator it = hash.end();
|
||||
QNetworkCacheMetaData::AttributesMap::ConstIterator begin = hash.begin();
|
||||
while (it != begin) {
|
||||
--it;
|
||||
QNetworkCacheMetaData::AttributesMap::ConstIterator it = hash.begin();
|
||||
QNetworkCacheMetaData::AttributesMap::ConstIterator end = hash.end();
|
||||
while (it != end) {
|
||||
out << int(it.key()) << it.value();
|
||||
++it;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
@ -383,7 +383,7 @@ static inline QDataStream &operator>>(QDataStream &in, QNetworkCacheMetaData::At
|
|||
int k;
|
||||
QVariant t;
|
||||
in >> k >> t;
|
||||
hash.insertMulti(QNetworkRequest::Attribute(k), t);
|
||||
hash.insert(QNetworkRequest::Attribute(k), t);
|
||||
}
|
||||
|
||||
if (in.status() != QDataStream::Ok)
|
||||
|
|
|
|||
Loading…
Reference in New Issue