Skip to content
Permalink
Browse files

Fix intermediate 100% download progress reports caused by redirects

(cherry-picked from 149ccf2)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent d39d268 commit c1b6e8f5ba44aa30e058c91375c7e2c9b186ea5c
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/qgsnetworkcontentfetchertask.cpp
@@ -45,11 +45,16 @@ bool QgsNetworkContentFetcherTask::run()
{
if ( bytesTotal > 0 )
{
setProgress( ( bytesReceived * 100 ) / bytesTotal );
int progress = ( bytesReceived * 100 ) / bytesTotal;
// don't emit 100% progress reports until completely fetched - otherwise we get
// intermediate 100% reports from redirects
if ( progress < 100 )
setProgress( progress );
}
} );
mFetcher->fetchContent( mRequest );
loop.exec();
setProgress( 100 );
emit fetched();
return true;
}

0 comments on commit c1b6e8f

Please sign in to comment.
You can’t perform that action at this time.