]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/progress.cc
* apt-pkg/contrib/progress.cc
[apt.git] / apt-pkg / contrib / progress.cc
index 8eb36fc20d680a43f86aec1e23e02e9846f08d1b..e3db9a45aa1720c1d791caca362139142d474461 100644 (file)
@@ -50,7 +50,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 +67,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 +115,8 @@ bool OpProgress::CheckChange(float Interval)
    
    if ((int)LastPercent == (int)Percent)
       return false;
+
+   LastPercent = Percent;
    
    if (Interval == 0)
       return false;
@@ -126,7 +128,6 @@ bool OpProgress::CheckChange(float Interval)
    if (Diff < Interval)
       return false;
    LastTime = Now;   
-   LastPercent = Percent;
    return true;
 }
                                                                        /*}}}*/