diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 2126c132..dff39f07 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -234,7 +234,9 @@ void DownloadList::close_directly(Download* download) { if (download->download()->is_active()) { download->download()->stop(torrent::Download::stop_skip_tracker); - torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume")); + + if (torrent::resume_check_target_files(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"))) + torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume")); } if (download->download()->is_open()) @@ -519,14 +521,12 @@ void DownloadList::received_finished(Download* download) { check_contains(download); - if (rpc::call_command_value("get_check_hash")) { + if (rpc::call_command_value("get_check_hash")) // Set some 'checking_finished_thingie' variable to make hash_done // trigger correctly, also so it can bork on missing data. hash_queue(download, Download::variable_hashing_last); - - } else { + else confirm_finished(download); - } } // The download must be open when we call this function. @@ -547,6 +547,8 @@ DownloadList::confirm_finished(Download* download) { // Do this before the slots are called in case one of them closes // the download. + // + // Obsolete. if (!download->is_active() && rpc::call_command_value("get_session_on_completion") != 0) { torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume")); control->core()->download_store()->save(download); diff --git a/src/display/window_file_list.cc b/src/display/window_file_list.cc index 6e8b30e2..be972763 100644 --- a/src/display/window_file_list.cc +++ b/src/display/window_file_list.cc @@ -68,7 +68,7 @@ wstring_width(const std::string& i_str, int width) { if (length == (size_t)-1) { wchar_t* out = result; - for (std::string::const_iterator itr = i_str.begin(); itr != i_str.end(); ++itr) + for (std::string::const_iterator itr = i_str.begin(); out != result + width && itr != i_str.end(); ++itr) if (!std::isprint(*itr, std::locale::classic())) *out++ = '?'; else diff --git a/src/main.cc b/src/main.cc index 246a4a8a..f6304a51 100644 --- a/src/main.cc +++ b/src/main.cc @@ -268,7 +268,7 @@ main(int argc, char** argv) { "view_add = seeding\n" "view_filter = seeding,\"and=d.get_state=,d.get_complete=\"\n" - "view_filter_on = seeding,event.download.resumed,event.download.paused\n" + "view_filter_on = seeding,event.download.resumed,event.download.paused,event.download.finished\n" "view_sort_new = seeding,less=d.get_state_changed=\n" "view_sort_current = seeding,less=d.get_state_changed=\n"