Fix package download progress computation.

The download progress and total used to be doubles, but now they are
off_t. This resulted in the division being done in integers, and always
getting 0 as the result.

Fixes #11940.
This commit is contained in:
Adrien Destugues 2015-04-05 19:13:08 +02:00
parent 85b350edda
commit 3c08e45613

View File

@ -139,7 +139,7 @@ FetchFileJob::_TransferCallback(void* _job, off_t downloadTotal,
if (downloadTotal != 0) {
job->fBytes = downloaded;
job->fTotalBytes = downloadTotal;
job->fDownloadProgress = downloaded / downloadTotal;
job->fDownloadProgress = (float)downloaded / downloadTotal;
job->NotifyStateListeners();
}
return 0;