Use asset sizes from the index to make the progress bar better

This commit is contained in:
Petr Mrázek
2013-12-15 15:00:09 +01:00
parent ae169abd74
commit 5a3043398e
12 changed files with 70 additions and 266 deletions

View File

@ -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())
{