X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/82c6b98d543274b6fd68dbb141392b4ffeaa3142..d6c4a9764d052c9755ab934c97c7a84c48ebd618:/apt-pkg/contrib/progress.cc diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 8eb36fc20..cffdddc4f 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -8,9 +8,6 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/progress.h" -#endif #include #include #include @@ -19,6 +16,7 @@ #include #include +#include /*}}}*/ using namespace std; @@ -50,7 +48,7 @@ void OpProgress::Progress(unsigned long Cur) // --------------------------------------------------------------------- /* */ void OpProgress::OverallProgress(unsigned long Current, unsigned long Total, - unsigned long Size,string Op) + unsigned long Size,const string &Op) { this->Current = Current; this->Total = Total; @@ -67,7 +65,7 @@ void OpProgress::OverallProgress(unsigned long Current, unsigned long Total, // OpProgress::SubProgress - Set the sub progress state /*{{{*/ // --------------------------------------------------------------------- /* */ -void OpProgress::SubProgress(unsigned long SubTotal,string Op) +void OpProgress::SubProgress(unsigned long SubTotal,const string &Op) { this->SubTotal = SubTotal; SubOp = Op; @@ -115,6 +113,8 @@ bool OpProgress::CheckChange(float Interval) if ((int)LastPercent == (int)Percent) return false; + + LastPercent = Percent; if (Interval == 0) return false; @@ -126,7 +126,6 @@ bool OpProgress::CheckChange(float Interval) if (Diff < Interval) return false; LastTime = Now; - LastPercent = Percent; return true; } /*}}}*/