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 149ccf2729250911e5f3c77fab9dbf6e5155432a
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 149ccf2

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