* Removed core::HashQueue, using the "hashing" view and a function in

core::Manager instead.

* Added a new :rtorrent:hashing state so we can distinguish between
initial hashing and manual rehashes. The former is cleared if the
download is paused.

* Added a hash failed flag to core::Download. This is used to skip
entries in the hashing view that either failed to open or are in the
process of being erased from DownloadList.

* torrent::Bitfield::unset was incrementing, rather than decrementing,
the m_set counter.

* Replaced all torrent::internal_error's in rtorrent with
torrent::client_error.

* ^D now checks :rtorrent:state to decide whetever to stop or erase a
download. Downloads queued for hashing will now stop rather than be
deleted.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@688 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-05-13 00:18:50 +00:00
parent 65f3dda9ab
commit d4706da4d5
22 changed files with 177 additions and 346 deletions
+8 -8
View File
@@ -60,15 +60,15 @@ View::~View() {
void
View::initialize(const std::string& name, core::DownloadList* dlist) {
if (!m_name.empty())
throw torrent::internal_error("View::initialize(...) called on an already initialized view.");
throw torrent::client_error("View::initialize(...) called on an already initialized view.");
if (name.empty())
throw torrent::internal_error("View::initialize(...) called with an empty name.");
throw torrent::client_error("View::initialize(...) called with an empty name.");
std::string key = "0_view_" + name;
if (dlist->has_slot_insert(key) || dlist->has_slot_erase(key))
throw torrent::internal_error("View::initialize(...) duplicate key name found in DownloadList.");
throw torrent::client_error("View::initialize(...) duplicate key name found in DownloadList.");
m_name = name;
m_list = dlist;
@@ -167,7 +167,7 @@ View::filter() {
void
View::set_filter_on(int event) {
if (event == DownloadList::SLOTS_INSERT || event == DownloadList::SLOTS_ERASE || event >= DownloadList::SLOTS_MAX_SIZE)
throw torrent::internal_error("View::filter_on(...) invalid event.");
throw torrent::client_error("View::filter_on(...) invalid event.");
m_list->slots(event)["0_view_" + m_name] = sigc::bind(sigc::mem_fun(this, &View::received), event);
}
@@ -193,7 +193,7 @@ View::insert_visible(Download* d) {
inline void
View::erase(iterator itr) {
if (itr == end_filtered())
throw torrent::internal_error("View::erase_visible(...) iterator out of range.");
throw torrent::client_error("View::erase_visible(...) iterator out of range.");
m_size -= (itr < end_visible());
m_focus -= (m_focus > position(itr));
@@ -209,7 +209,7 @@ View::received(core::Download* download, int event) {
case DownloadList::SLOTS_INSERT:
if (itr != base_type::end())
throw torrent::internal_error("View::received(..., SLOTS_INSERT) already inserted.");
throw torrent::client_error("View::received(..., SLOTS_INSERT) already inserted.");
if (view_downloads_filter(m_filter)(download))
insert_visible(download);
@@ -217,7 +217,7 @@ View::received(core::Download* download, int event) {
base_type::insert(end_filtered(), download);
if (m_focus > m_size)
throw torrent::internal_error("View::received(...) m_focus > m_size.");
throw torrent::client_error("View::received(...) m_focus > m_size.");
break;
@@ -227,7 +227,7 @@ View::received(core::Download* download, int event) {
default:
if (itr == end_filtered())
throw torrent::internal_error("View::received(..., SLOTS_*) could not find download.");
throw torrent::client_error("View::received(..., SLOTS_*) could not find download.");
if (view_downloads_filter(m_filter)(download)) {