From 1a7c9eba99a9521a7722be37d6bafe5fa4936630 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:56 +0000 Subject: Big changes Author: jgg Date: 1998-08-23 03:52:22 GMT Big changes --- apt-pkg/contrib/progress.cc | 10 ++++++++-- apt-pkg/contrib/progress.h | 8 +++++--- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index aae0ea1e3..4be7b87b9 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: progress.cc,v 1.4 1998/07/26 04:51:45 jgg Exp $ +// $Id: progress.cc,v 1.5 1998/08/23 03:52:22 jgg Exp $ /* ###################################################################### OpProgress - Operation Progress @@ -76,9 +76,14 @@ bool OpProgress::CheckChange(float Interval) } MajorChange = false; + if (SubOp != LastSubOp) + { + LastSubOp = SubOp; + return true; + } + if ((int)LastPercent == (int)Percent) return false; - LastPercent = Percent; // Check time delta struct timeval Now; @@ -87,6 +92,7 @@ bool OpProgress::CheckChange(float Interval) if (Diff < Interval) return false; LastTime = Now; + LastPercent = Percent; return true; } /*}}}*/ diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h index 39e770fa3..e3530cdcb 100644 --- a/apt-pkg/contrib/progress.h +++ b/apt-pkg/contrib/progress.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: progress.h,v 1.1 1998/07/21 05:33:21 jgg Exp $ +// $Id: progress.h,v 1.2 1998/08/23 03:52:23 jgg Exp $ /* ###################################################################### OpProgress - Operation Progress @@ -40,6 +40,7 @@ class OpProgress // Change reduction code struct timeval LastTime; string LastOp; + string LastSubOp; protected: @@ -58,7 +59,8 @@ class OpProgress void SubProgress(unsigned long SubTotal,string Op); void OverallProgress(unsigned long Current,unsigned long Total, unsigned long Size,string Op); - + virtual void Done() {}; + OpProgress(); virtual ~OpProgress() {}; }; @@ -75,7 +77,7 @@ class OpTextProgress : public OpProgress public: - void Done(); + virtual void Done(); OpTextProgress(bool NoUpdate = false) : NoUpdate(NoUpdate), LastLen(0) {}; virtual ~OpTextProgress() {Done();}; -- cgit v1.2.3