From c95eb62802112219c9874832defdaf280745882e Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 15 Jun 2006 00:46:13 +0000 Subject: [PATCH] * Second part of reworking how multiple downloads of the same chunk is handled. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@721 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/download_list.cc | 2 +- src/display/window_download_transfer_list.cc | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 490b71c4..3e7f9e4c 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -403,7 +403,7 @@ DownloadList::hash_done(Download* download) { // If the download was previously completed but the files were // f.ex deleted, then we clear the state and complete. - if (!download->variable()->get_value("complete") && download->is_done()) { + if (download->variable()->get_value("complete") && !download->is_done()) { download->variable()->set("state", (int64_t)0); download->set_message("Download registered as completed, but hash check returned unfinished chunks."); } diff --git a/src/display/window_download_transfer_list.cc b/src/display/window_download_transfer_list.cc index 7f6d1912..f4447e82 100644 --- a/src/display/window_download_transfer_list.cc +++ b/src/display/window_download_transfer_list.cc @@ -82,20 +82,27 @@ WindowDownloadTransferList::redraw() { chtype attr = A_NORMAL; if (bItr->transfers()->size() >= 1) { - attr = A_BOLD; - id = key_id(bItr->transfers()->back()->const_peer_info()); + + if (bItr->leader() != NULL) { + attr = A_REVERSE; + id = key_id(bItr->leader()->const_peer_info()); + } else { + attr = A_REVERSE | A_UNDERLINE; + id = key_id(bItr->transfers()->back()->const_peer_info()); + } if (bItr->transfers()->size() > 1) - id = std::tolower(id); + attr = A_BOLD; } else if (bItr->queued()->size() >= 1) { id = key_id(bItr->queued()->back()->const_peer_info()); if (bItr->queued()->size() > 1) - id = std::tolower(id); + attr = A_BOLD; } else if (bItr->is_finished()) { - // Temporary until + // Temporary until we fix the code so transfers are kept + // around. id = '*'; } else {