mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 06:39:23 +00:00
* Added man page entries for view_* and session_save.
* Moved around resume save so it doesn't bork on completed last hash check. * torrent::Download::hash_resume_clear() no longer removes priority and mtime information, only the bitfield. * Added a quick hack that allows libtorrent to split large files. The parameter needs to be set in the source, no API available yet. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@681 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -339,10 +339,7 @@ DownloadList::check_hash_throw(Download* download) {
|
||||
|
||||
close_throw(download);
|
||||
download->download()->hash_resume_clear();
|
||||
|
||||
open_throw(download);
|
||||
download->download()->hash_resume_save();
|
||||
|
||||
|
||||
// If any more stuff is added here, make sure resume etc are still
|
||||
// correct.
|
||||
@@ -353,7 +350,9 @@ void
|
||||
DownloadList::hash_done(Download* download) {
|
||||
check_contains(download);
|
||||
|
||||
if (!download->download()->is_hash_checked() || download->download()->is_hash_checking())
|
||||
if (!download->download()->is_hash_checked() ||
|
||||
download->download()->is_hash_checking() ||
|
||||
download->download()->is_active())
|
||||
throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state.");
|
||||
|
||||
// Need to find some sane conditional here. Can we check the total
|
||||
@@ -375,6 +374,10 @@ DownloadList::hash_done(Download* download) {
|
||||
if (download->is_done())
|
||||
download->variable()->set("complete", (int64_t)1);
|
||||
|
||||
// Save resume data so we update time-stamps and priorities if
|
||||
// they were invalid/changed when loading.
|
||||
download->download()->hash_resume_save();
|
||||
|
||||
if (download->variable()->get_value("state") == 1)
|
||||
resume(download);
|
||||
|
||||
@@ -432,12 +435,12 @@ DownloadList::confirm_finished(Download* download) {
|
||||
|
||||
download->download()->tracker_list().send_completed();
|
||||
|
||||
download->download()->hash_resume_save();
|
||||
|
||||
// Do this before the slots are called in case one of them closes
|
||||
// the download.
|
||||
if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1)
|
||||
if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1) {
|
||||
download->download()->hash_resume_save();
|
||||
control->core()->download_store()->save(download);
|
||||
}
|
||||
|
||||
std::for_each(m_slotMapFinished.begin(), m_slotMapFinished.end(), download_list_call(download));
|
||||
}
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
|
||||
namespace core {
|
||||
|
||||
class ViewSortFalse : public ViewSort {
|
||||
public:
|
||||
virtual bool operator () (Download* d1, Download* d2) const {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class ViewSortName : public ViewSort {
|
||||
public:
|
||||
virtual bool operator () (Download* d1, Download* d2) const {
|
||||
@@ -117,7 +124,7 @@ ViewManager::ViewManager(DownloadList* dl) :
|
||||
m_list(dl) {
|
||||
|
||||
// m_sort["first"] = new ViewSortNot(new ViewSort());
|
||||
// m_sort["last"] = new ViewSort();
|
||||
m_sort["last"] = new ViewSortFalse();
|
||||
m_sort["name"] = new ViewSortName();
|
||||
m_sort["name_reverse"] = new ViewSortReverse(new ViewSortName());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user