choke downloadProgress signals
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Thu, 24 May 2012 15:14:28 +0000 (16:14 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 14 Jun 2012 03:26:35 +0000 (05:26 +0200)
commitd6d9c8bf3245ec3d1ff05ae45d54baac64d76cec
treea06dd484063c9ad94ad21b98241b0d1afe4d0961
parent5a7937bb042a006482ed50f7b7de437e15e593ce
choke downloadProgress signals

The QNetworkReply::downloadProgress signal is intended for updating
user interface components (e.g. a progress bar).
Limit signal emissions to 10 times per second, with an additional
signal just before the finished() signal to provide the 100% progress.

For the size of download where a progress bar is necessary, this
update frequency seems sufficient.

The implementation is done by dropping signals which would be emitted
less than 100ms after the previous signal emission.

Task-number: QTBUG-20449
Change-Id: I9c2dbe16c70f3270cbf98f3c74cf9d9a3f0ab900
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
src/network/access/qnetworkreply.cpp
src/network/access/qnetworkreply_p.h
src/network/access/qnetworkreplyhttpimpl.cpp
src/network/access/qnetworkreplyhttpimpl_p.h
src/network/access/qnetworkreplyimpl.cpp