From 5a3043398e45cbe39455609a42463f2e6e5d3fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 15 Dec 2013 15:00:09 +0100 Subject: Use asset sizes from the index to make the progress bar better --- logic/net/NetJob.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'logic/net/NetJob.h') diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 6e2e7607..68c4c408 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -36,10 +36,16 @@ public: template bool addNetAction(T action) { NetActionPtr base = std::static_pointer_cast(action); - base->index_within_job = downloads.size(); + base->m_index_within_job = downloads.size(); downloads.append(action); - parts_progress.append(part_info()); - total_progress++; + part_info pi; + { + pi.current_progress = base->currentProgress(); + pi.total_progress = base->totalProgress(); + pi.failures = base->numberOfFailures(); + } + parts_progress.append(pi); + total_progress += pi.total_progress; // if this is already running, the action needs to be started right away! if (isRunning()) { -- cgit v1.2.3