summaryrefslogtreecommitdiff
path: root/src/ui_download_manager.h
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2009-10-10 11:10:46 -0700
committerDaniel Burrows <dburrows@debian.org>2009-10-10 11:10:46 -0700
commitdc4045b8a4dc2ad61f4589d2d30078d47e974c57 (patch)
tree90f005d891cf91970867457b728920114cbf6d1c /src/ui_download_manager.h
parent0cc83f2ebc7c2c82f957a5435ee5bbe71df938ab (diff)
downloadaptitude-dc4045b8a4dc2ad61f4589d2d30078d47e974c57.tar.gz
Push the setup phase of the changelog download into a background thread.
The setup phase is somewhat I/O intensive; this avoids blocking the UI while it's going on. Also, this converts the ui_download_manager and ui_download_thread classes to using boost::shared_ptr to store the download manager; that should make its memory management a lot simpler.
Diffstat (limited to 'src/ui_download_manager.h')
-rw-r--r--src/ui_download_manager.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui_download_manager.h b/src/ui_download_manager.h
index 762edf13..cd1deea0 100644
--- a/src/ui_download_manager.h
+++ b/src/ui_download_manager.h
@@ -36,6 +36,8 @@
#include <sigc++/signal.h>
#include <sigc++/trackable.h>
+#include <boost/shared_ptr.hpp>
+
/** \brief Glue code to go between the UI and the download manager/thread stuff
*
* \file ui_download_manager.h
@@ -123,7 +125,7 @@ class ui_download_manager : public sigc::trackable
}
};
- download_manager *manager;
+ boost::shared_ptr<download_manager> manager;
aborter abort_state;
@@ -214,7 +216,7 @@ public:
* foreground thread.
*/
template<typename T>
- ui_download_manager(download_manager *_manager,
+ ui_download_manager(const boost::shared_ptr<download_manager> &_manager,
download_signal_log *_log,
const cwidget::util::ref_ptr<T> &_download_status,
const make_refcounted_progress_slot &_make_progress_bar,