From a4139682a7277385b5e2bc35829e94137584573a Mon Sep 17 00:00:00 2001 From: kh1 Date: Fri, 6 Sep 2013 12:37:07 +0200 Subject: fix progress for redirected HTTP Downloads - do not emit the progress in the redirect case for the redirect data Task-number: QTIFW-267 Change-Id: Id32018a92df3098e45c963b4dcf7924bebdd1354 Reviewed-by: Karsten Heimrich Reviewed-by: Niels Weber --- src/libs/kdtools/kdupdaterfiledownloader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/libs/kdtools/kdupdaterfiledownloader.cpp b/src/libs/kdtools/kdupdaterfiledownloader.cpp index fee2a853e..a7fbfe85b 100644 --- a/src/libs/kdtools/kdupdaterfiledownloader.cpp +++ b/src/libs/kdtools/kdupdaterfiledownloader.cpp @@ -979,6 +979,12 @@ void KDUpdater::HttpDownloader::httpReqFinished() void KDUpdater::HttpDownloader::httpReadProgress(qint64 done, qint64 total) { + if (d->http) { + const QUrl redirectUrl = d->http->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); + if (followRedirects() && redirectUrl.isValid()) + return; // if we are a redirection, do not emit the progress + } + setProgress(done, total); emit downloadProgress(calcProgress(done, total)); } -- cgit v1.2.3