summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-09-06 12:37:07 +0200
committerTim Jenssen <tim.jenssen@digia.com>2013-09-09 13:08:33 +0200
commita4139682a7277385b5e2bc35829e94137584573a (patch)
tree1bb3a6a44d4b7d2561a4301f6e2627c474429fdd /src
parent84c8a408327f7386905d7faa4c682618cbf46455 (diff)
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 <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloader.cpp6
1 files changed, 6 insertions, 0 deletions
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));
}