diff options
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 47751aa2c6..22c3c49c58 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -830,7 +830,8 @@ ReturnedValue Document::load(ExecutionEngine *v4, const QByteArray &data) } nodeStack.append(node); - foreach (const QXmlStreamAttribute &a, reader.attributes()) { + const auto attributes = reader.attributes(); + for (const QXmlStreamAttribute &a : attributes) { NodeImpl *attr = new NodeImpl; attr->document = document; attr->type = NodeImpl::Attr; @@ -1184,10 +1185,10 @@ QString QQmlXMLHttpRequest::headers() const void QQmlXMLHttpRequest::fillHeadersList() { - QList<QByteArray> headerList = m_network->rawHeaderList(); + const QList<QByteArray> headerList = m_network->rawHeaderList(); m_headersList.clear(); - foreach (const QByteArray &header, headerList) { + for (const QByteArray &header : headerList) { HeaderPair pair (header.toLower(), m_network->rawHeader(header)); if (pair.first == "set-cookie" || pair.first == "set-cookie2") @@ -1445,7 +1446,7 @@ void QQmlXMLHttpRequest::finished() void QQmlXMLHttpRequest::readEncoding() { - foreach (const HeaderPair &header, m_headersList) { + for (const HeaderPair &header : qAsConst(m_headersList)) { if (header.first == "content-type") { int separatorIdx = header.second.indexOf(';'); if (separatorIdx == -1) { |