diff options
author | Tapani Mikola <tapani.mikola@nokia.com> | 2009-09-14 11:13:03 (GMT) |
---|---|---|
committer | Tapani Mikola <tapani.mikola@nokia.com> | 2009-09-18 07:02:05 (GMT) |
commit | b88bcd68a62ab8ed348bc698f7342346963bb7c0 (patch) | |
tree | 325a2e1071787f5a779c259c75a0f69a8038148d /src/declarative/qml | |
parent | 332801a96a1ad21184daa139f6641a66c43e6b48 (diff) | |
download | Qt-b88bcd68a62ab8ed348bc698f7342346963bb7c0.zip Qt-b88bcd68a62ab8ed348bc698f7342346963bb7c0.tar.gz Qt-b88bcd68a62ab8ed348bc698f7342346963bb7c0.tar.bz2 |
XMLHttpRequest status and statusText were not set in finished or error.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlxmlhttprequest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlxmlhttprequest.cpp b/src/declarative/qml/qmlxmlhttprequest.cpp index 3ca61ae..65c5b16 100644 --- a/src/declarative/qml/qmlxmlhttprequest.cpp +++ b/src/declarative/qml/qmlxmlhttprequest.cpp @@ -1124,6 +1124,11 @@ void QmlXMLHttpRequest::downloadProgress(qint64 bytes) void QmlXMLHttpRequest::error(QNetworkReply::NetworkError error) { + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + m_responseEntityBody = QByteArray(); m_errorFlag = true; m_request = QNetworkRequest(); @@ -1138,6 +1143,11 @@ void QmlXMLHttpRequest::finished() { // ### We need to transparently redirect as dictated by the spec + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + if (m_state < HeadersReceived) { m_state = HeadersReceived; fillHeadersList (); |