mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 12:46:18 +00:00
* Added resume functions for saving/loading tracker state.
* Added parameter to torrent::resume_save_progress to indicate that only completed files are to be saved. This is used when the torrent is active. * Update the display when priority is changed. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@746 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -193,6 +193,7 @@ DownloadFactory::receive_success() {
|
|||||||
|
|
||||||
torrent::resume_load_addresses(*download->download(), resumeObject);
|
torrent::resume_load_addresses(*download->download(), resumeObject);
|
||||||
torrent::resume_load_file_priorities(*download->download(), resumeObject);
|
torrent::resume_load_file_priorities(*download->download(), resumeObject);
|
||||||
|
torrent::resume_load_tracker_settings(*download->download(), resumeObject);
|
||||||
|
|
||||||
// The action of inserting might cause the torrent to be
|
// The action of inserting might cause the torrent to be
|
||||||
// opened/started or such. Figure out a nicer way of handling this.
|
// opened/started or such. Figure out a nicer way of handling this.
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ DownloadList::resume(Download* download) {
|
|||||||
// on non-complete downloads after a crash. This shouldn't be
|
// on non-complete downloads after a crash. This shouldn't be
|
||||||
// needed, but for some reason linux 2.6 is very lazy about
|
// needed, but for some reason linux 2.6 is very lazy about
|
||||||
// updating mtime.
|
// updating mtime.
|
||||||
torrent::resume_clear_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
|
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the priority to ensure it has the correct
|
// Update the priority to ensure it has the correct
|
||||||
|
|||||||
@@ -109,8 +109,11 @@ DownloadStore::save(Download* d) {
|
|||||||
d->bencode()->get_key("rtorrent").insert_key("total_uploaded", d->download()->up_rate()->total());
|
d->bencode()->get_key("rtorrent").insert_key("total_uploaded", d->download()->up_rate()->total());
|
||||||
d->bencode()->get_key("rtorrent").insert_key("chunks_done", d->download()->chunks_done());
|
d->bencode()->get_key("rtorrent").insert_key("chunks_done", d->download()->chunks_done());
|
||||||
|
|
||||||
torrent::resume_save_addresses(*d->download(), d->download()->bencode()->get_key("libtorrent_resume"));
|
torrent::Object& resumeObject = d->download()->bencode()->get_key("libtorrent_resume");
|
||||||
torrent::resume_save_file_priorities(*d->download(), d->download()->bencode()->get_key("libtorrent_resume"));
|
|
||||||
|
torrent::resume_save_addresses(*d->download(), resumeObject);
|
||||||
|
torrent::resume_save_file_priorities(*d->download(), resumeObject);
|
||||||
|
torrent::resume_save_tracker_settings(*d->download(), resumeObject);
|
||||||
|
|
||||||
f << *d->bencode();
|
f << *d->bencode();
|
||||||
|
|
||||||
|
|||||||
@@ -107,11 +107,11 @@ Manager::unschedule(Window* w) {
|
|||||||
void
|
void
|
||||||
Manager::adjust_layout() {
|
Manager::adjust_layout() {
|
||||||
int staticHeight = std::for_each(begin(), end(),
|
int staticHeight = std::for_each(begin(), end(),
|
||||||
rak::if_then(std::mem_fun(&Window::is_active),
|
rak::if_then(std::mem_fun(&Window::is_active),
|
||||||
rak::accumulate(0, std::mem_fun(&Window::get_min_height)))).m_then.result;
|
rak::accumulate(0, std::mem_fun(&Window::get_min_height)))).m_then.result;
|
||||||
int countDynamic = std::for_each(begin(), end(),
|
int countDynamic = std::for_each(begin(), end(),
|
||||||
rak::if_then(std::mem_fun(&Window::is_active),
|
rak::if_then(std::mem_fun(&Window::is_active),
|
||||||
rak::accumulate(0, std::mem_fun(&Window::is_dynamic)))).m_then.result;
|
rak::accumulate(0, std::mem_fun(&Window::is_dynamic)))).m_then.result;
|
||||||
|
|
||||||
int dynamic = std::max(0, Canvas::get_screen_height() - staticHeight);
|
int dynamic = std::max(0, Canvas::get_screen_height() - staticHeight);
|
||||||
int height = 0, h;
|
int height = 0, h;
|
||||||
@@ -166,8 +166,7 @@ Manager::schedule_update() {
|
|||||||
|
|
||||||
if (!m_taskUpdate.is_queued() || m_taskUpdate.time() > m_scheduler.top()->time()) {
|
if (!m_taskUpdate.is_queued() || m_taskUpdate.time() > m_scheduler.top()->time()) {
|
||||||
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
rak::priority_queue_erase(&taskScheduler, &m_taskUpdate);
|
||||||
rak::priority_queue_insert(&taskScheduler, &m_taskUpdate,
|
rak::priority_queue_insert(&taskScheduler, &m_taskUpdate, std::max(m_scheduler.top()->time(), m_timeLastUpdate + 50000));
|
||||||
std::max(m_scheduler.top()->time(), m_timeLastUpdate + 50000));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ DownloadList::receive_next_priority() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
(*m_view->focus())->set_priority(((*m_view->focus())->priority() + 1) % 4);
|
(*m_view->focus())->set_priority(((*m_view->focus())->priority() + 1) % 4);
|
||||||
|
(*m_window)->mark_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -272,6 +273,7 @@ DownloadList::receive_prev_priority() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
(*m_view->focus())->set_priority(((*m_view->focus())->priority() - 1) % 4);
|
(*m_view->focus())->set_priority(((*m_view->focus())->priority() - 1) % 4);
|
||||||
|
(*m_window)->mark_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user