Skip to content
Permalink
Browse files
Fix intermediate 100% download progress reports caused by redirects
  • Loading branch information
nyalldawson committed Apr 1, 2018
1 parent e2f09fa commit 149ccf2
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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 149ccf2

Please sign in to comment.