diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-09 14:38:01 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-09 14:38:01 +0200 |
commit | 216d0bd8869c4f52ead5256064512ac97e9fc824 (patch) | |
tree | ea6911a231e29b73a883d4449fe7f88941ddd92d /apt-pkg/contrib/progress.cc | |
parent | 629b60f6feea2d2d356645aa2615b212481bd3d8 (diff) | |
parent | 97efc27f0723f09405d7a1836ab21c2e2948eb10 (diff) |
merged from the debian-experimental2 branch
Diffstat (limited to 'apt-pkg/contrib/progress.cc')
-rw-r--r-- | apt-pkg/contrib/progress.cc | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 45e81edcb..84ee4c124 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -65,27 +65,18 @@ void OpProgress::OverallProgress(unsigned long Current, unsigned long Total, // OpProgress::SubProgress - Set the sub progress state /*{{{*/ // --------------------------------------------------------------------- /* */ -void OpProgress::SubProgress(unsigned long SubTotal,const string &Op) +void OpProgress::SubProgress(unsigned long SubTotal,const string &Op, + float const Percent) { this->SubTotal = SubTotal; - SubOp = Op; - if (Total == 0) - Percent = 0; + if (Op.empty() == false) + SubOp = Op; + if (Total == 0 || Percent == 0) + this->Percent = 0; + else if (Percent != -1) + this->Percent = this->Current += (Size*Percent)/SubTotal; else - Percent = Current*100.0/Total; - Update(); -} - /*}}}*/ -// OpProgress::SubProgress - Set the sub progress state /*{{{*/ -// --------------------------------------------------------------------- -/* */ -void OpProgress::SubProgress(unsigned long SubTotal) -{ - this->SubTotal = SubTotal; - if (Total == 0) - Percent = 0; - else - Percent = Current*100.0/Total; + this->Percent = Current*100.0/Total; Update(); } /*}}}*/ |