[Debtags-commits] [svn] r1534 - central-database/trunk/aptfront

Enrico Zini enrico at costa.debian.org
Wed Feb 1 22:25:29 UTC 2006


Author: enrico
Date: Wed Feb  1 22:25:29 2006
New Revision: 1534

Modified:
   central-database/trunk/aptfront/sitegen.cc
Log:
Added fixed progress function


Modified: central-database/trunk/aptfront/sitegen.cc
==============================================================================
--- central-database/trunk/aptfront/sitegen.cc	(original)
+++ central-database/trunk/aptfront/sitegen.cc	Wed Feb  1 22:25:29 2006
@@ -10,6 +10,26 @@
 using namespace aptFront;
 using namespace aptFront::cache::component;
 
+
+class Progress : public ProgressCallback
+{
+protected:
+	bool Pulse(pkgAcquire *Owner)
+	{
+		ProgressCallback::Pulse(Owner);
+		return true;
+	}
+
+public:
+	Progress() {};
+	virtual ~Progress() {};
+	virtual bool MediaChange(string Media,string Drive) { return false; }
+
+	// override this to get periodic updates
+	virtual void UpdatePulse(double FetchedBytes, double CurrentCPS, unsigned long CurrentItems)
+	{}
+};
+
 // "custom" setup from apt-front/init.cc, namepsace tut
 void aptInit () {
     static bool done = false;
@@ -34,7 +54,7 @@
 void aptUpdate () { 
 // apt-get update code from adept-updater
     aptFront::Manager m;
-    m.setProgressCallback( SharedPtr<ProgressCallback>(new ProgressCallback()) );
+    m.setProgressCallback( SharedPtr<ProgressCallback>(new Progress()) );
     m.setUpdateInterval( 100000 );
     try {
         m.update();



More information about the Debtags-commits mailing list