From cccef6ca60c2775e918d964fdad1afc1dcad4d0e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 29 Apr 2019 20:05:38 +0200 Subject: acq: worker: Move CurrentSize, TotalSize, ResumePoint to CurrentItem These status fields belong to the current item, move them there. This prepares us for eventually having multiple current items. --- apt-private/acqprogress.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-private') diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index 6cf200f5b..b37934cd4 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -221,21 +221,21 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) enum {Long = 0,Medium,Short} Mode = Medium; // Add the current progress if (Mode == Long) - S << " " << std::to_string(I->CurrentSize); + S << " " << std::to_string(I->CurrentItem->CurrentSize); else { - if (Mode == Medium || I->TotalSize == 0) - S << " " << SizeToStr(I->CurrentSize) << "B"; + if (Mode == Medium || I->CurrentItem->TotalSize == 0) + S << " " << SizeToStr(I->CurrentItem->CurrentSize) << "B"; } // Add the total size and percent - if (I->TotalSize > 0 && I->CurrentItem->Owner->Complete == false) + if (I->CurrentItem->TotalSize > 0 && I->CurrentItem->Owner->Complete == false) { if (Mode == Short) - ioprintf(S, " %.0f%%", (I->CurrentSize*100.0)/I->TotalSize); + ioprintf(S, " %.0f%%", (I->CurrentItem->CurrentSize*100.0)/I->CurrentItem->TotalSize); else - ioprintf(S, "/%sB %.0f%%", SizeToStr(I->TotalSize).c_str(), - (I->CurrentSize*100.0)/I->TotalSize); + ioprintf(S, "/%sB %.0f%%", SizeToStr(I->CurrentItem->TotalSize).c_str(), + (I->CurrentItem->CurrentSize*100.0)/I->CurrentItem->TotalSize); } S << "]"; } -- cgit v1.2.3-18-g5258