summaryrefslogtreecommitdiff
path: root/apt-pkg/iprogress.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-10-11 22:48:22 +0200
committerMichael Vogt <mvo@debian.org>2013-10-11 22:48:22 +0200
commit6c5ae8ed079e01082f606614641b19b7c08893ad (patch)
tree30d168e66eed72236853fe8ce99e4d7bcae2bcb0 /apt-pkg/iprogress.h
parentdb78c60c6a726ed70fa8b0984090b80840444016 (diff)
move common code into PackageManager::StatusChanged()
Diffstat (limited to 'apt-pkg/iprogress.h')
-rw-r--r--apt-pkg/iprogress.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/apt-pkg/iprogress.h b/apt-pkg/iprogress.h
index f097e0943..5f1655ab9 100644
--- a/apt-pkg/iprogress.h
+++ b/apt-pkg/iprogress.h
@@ -14,21 +14,26 @@ namespace Progress {
/** \brief dpointer placeholder */
void *d;
+ protected:
+ std::string progress_str;
+ float percentage;
+ int last_reported_progress;
+
public:
+ PackageManager() : percentage(0.0), last_reported_progress(0) {};
virtual ~PackageManager() {};
virtual void Started() {};
virtual void Finished() {};
- virtual void StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
- unsigned int TotalSteps) {};
+ unsigned int TotalSteps);
};
class PackageManagerFancy : public PackageManager
{
protected:
- int last_reported_progress;
int nr_terminal_rows;
void SetupTerminalScrollArea(int nr_rows);
@@ -36,19 +41,15 @@ namespace Progress {
PackageManagerFancy();
virtual void Started();
virtual void Finished();
- virtual void StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps);
};
class PackageManagerText : public PackageManager
{
- protected:
- int last_reported_progress;
-
public:
- PackageManagerText() : last_reported_progress(0) {};
- virtual void StatusChanged(std::string PackageName,
+ virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps);