Skip to content

Commit

Permalink
Fix intermediate 100% download progress reports caused by redirects
Browse files Browse the repository at this point in the history
(cherry-picked from 149ccf2)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent d39d268 commit c1b6e8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/qgsnetworkcontentfetchertask.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit c1b6e8f

Please sign in to comment.