summaryrefslogtreecommitdiffstats
path: root/logic/net/NetJob.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-15 15:00:09 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-15 15:00:09 +0100
commit5a3043398e45cbe39455609a42463f2e6e5d3fd2 (patch)
treeded26672e798e3d4da9c53cb962d39c58d0e3fa9 /logic/net/NetJob.h
parentae169abd74571df2ab002c6ebf2962fed937391a (diff)
downloadMultiMC-5a3043398e45cbe39455609a42463f2e6e5d3fd2.tar
MultiMC-5a3043398e45cbe39455609a42463f2e6e5d3fd2.tar.gz
MultiMC-5a3043398e45cbe39455609a42463f2e6e5d3fd2.tar.lz
MultiMC-5a3043398e45cbe39455609a42463f2e6e5d3fd2.tar.xz
MultiMC-5a3043398e45cbe39455609a42463f2e6e5d3fd2.zip
Use asset sizes from the index to make the progress bar better
Diffstat (limited to 'logic/net/NetJob.h')
-rw-r--r--logic/net/NetJob.h12
1 files changed, 9 insertions, 3 deletions
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 <typename T> bool addNetAction(T action)
{
NetActionPtr base = std::static_pointer_cast<NetAction>(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())
{