diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-06-01 15:33:28 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-06 15:31:50 +0200 |
commit | ef4c147e11007a47d4adf49a61d6aeae497574ab (patch) | |
tree | f9f7de3429a173539142c1464b11720e8233f17f /src | |
parent | f2571b3f0ce5ca85930627b28d7ba735126225a5 (diff) |
QDeclarativeXmlHttpRequest - use readyread signal not downloadProgress
The readyRead signal (part of QIODevice base class) is the
appropriate signal for knowing when there is data available
in a QNetworkReply.
DownloadProgress is intended for UI elements e.g. progress bars.
Previously it was emitted at the same time, but now it is emitted
less often.
Task-number: QTBUG-20449
Change-Id: I732a2facb083f4cc35d01441a34964847f00fdb2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index f71727aa..7203d085 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -971,7 +971,7 @@ public: const QByteArray & rawResponseBody() const; bool receivedXml() const; private slots: - void downloadProgress(qint64); + void readyRead(); void error(QNetworkReply::NetworkError); void finished(); @@ -1164,8 +1164,8 @@ void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url) else if(m_method == QLatin1String("PUT")) m_network = networkAccessManager()->put(request, m_data); - QObject::connect(m_network, SIGNAL(downloadProgress(qint64,qint64)), - this, SLOT(downloadProgress(qint64))); + QObject::connect(m_network, SIGNAL(readyRead()), + this, SLOT(readyRead())); QObject::connect(m_network, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError))); QObject::connect(m_network, SIGNAL(finished()), @@ -1206,9 +1206,8 @@ QScriptValue QDeclarativeXMLHttpRequest::abort(QScriptValue *me) return QScriptValue(); } -void QDeclarativeXMLHttpRequest::downloadProgress(qint64 bytes) +void QDeclarativeXMLHttpRequest::readyRead() { - Q_UNUSED(bytes) m_status = m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); m_statusText = |