[Aptitude-svn-commit] r4331 - in branches/aptitude-0.3/aptitude: .
src
Daniel Burrows
dburrows at costa.debian.org
Thu Sep 29 21:29:47 UTC 2005
Author: dburrows
Date: Thu Sep 29 21:29:44 2005
New Revision: 4331
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/download_thread.cc
branches/aptitude-0.3/aptitude/src/download_thread.h
Log:
Let the download thread be created using a download manager instead of an acquire object.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Thu Sep 29 21:29:44 2005
@@ -1,5 +1,10 @@
2005-09-29 Daniel Burrows <dburrows at debian.org>
+ * src/download_thread.cc, src/download_thread.h:
+
+ Accept download managers instead of acquire objects as the
+ thread parameter.
+
* src/generic/apt/download_manager.h:
Make download managers SigC++ trackable objects.
Modified: branches/aptitude-0.3/aptitude/src/download_thread.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/download_thread.cc (original)
+++ branches/aptitude-0.3/aptitude/src/download_thread.cc Thu Sep 29 21:29:44 2005
@@ -19,6 +19,7 @@
#include "download_thread.h"
+#include <generic/apt/download_manager.h>
#include <generic/apt/download_signal_log.h>
#include <vscreen/vscreen.h>
@@ -224,6 +225,6 @@
void download_thread::operator()()
{
- vscreen_post_event(new download_thread_complete_event(this, acq->Run(),
+ vscreen_post_event(new download_thread_complete_event(this, m->do_download(),
continuation));
}
Modified: branches/aptitude-0.3/aptitude/src/download_thread.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/download_thread.h (original)
+++ branches/aptitude-0.3/aptitude/src/download_thread.h Thu Sep 29 21:29:44 2005
@@ -27,6 +27,7 @@
#include <sigc++/slot.h>
+class download_manager;
class download_signal_log;
/** A proxy status object that posts messages to the main thread.
@@ -63,11 +64,12 @@
{
threads::box<bool> cancelled;
- /** The bundled pkgAcquire object. It should have been initialized
- * using a background_status wrapper as above, and you should
- * join() this thread before deleting it.
+ /** The bundled download_manager object. It should have been
+ * initialized using a background_status wrapper as above, and you
+ * should join() this thread before deleting it. (it is also OK
+ * to join() the thread first thing in the object's destructor)
*/
- pkgAcquire *acq;
+ download_manager *m;
/** The continuation of this download, invoked in the main thread
* with this thread and the result of the run as parameters. The
@@ -81,9 +83,9 @@
download_thread(const download_thread &other);
download_thread &operator=(const download_thread &other);
public:
- download_thread(pkgAcquire *_acq,
+ download_thread(download_manager *manager,
const sigc::slot2<void, download_thread *, pkgAcquire::RunResult> &_continuation)
- : cancelled(false), acq(_acq), continuation(_continuation), t(NULL)
+ : cancelled(false), m(manager), continuation(_continuation), t(NULL)
{
}
More information about the Aptitude-svn-commit
mailing list