From 3c08e456131e6cd40063bcb1c1e889e452c2feb8 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 5 Apr 2015 19:13:08 +0200 Subject: [PATCH] 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. --- src/kits/package/FetchFileJob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/package/FetchFileJob.cpp b/src/kits/package/FetchFileJob.cpp index ff1bad4748..1c88cc1790 100644 --- a/src/kits/package/FetchFileJob.cpp +++ b/src/kits/package/FetchFileJob.cpp @@ -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;