* Cleanup of the API, got rid of "get_" prefix for alot of the calls.

* Tweaked the http get timeout, now it has a 60 second connect timeout
and a 360 second download timeout.

* Moved libtorrent/src/parse/download_constructor to src/download.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@595 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-11-12 15:31:12 +00:00
parent 3db8179274
commit a97408328a
22 changed files with 142 additions and 138 deletions
+5 -5
View File
@@ -60,7 +60,7 @@ Download::Download(DPtr d, Control* c) :
m_download(d),
m_state(DISPLAY_MAX_SIZE),
m_windowTitle(new WTitle(d->get_download().get_name())),
m_windowTitle(new WTitle(d->get_download().name())),
m_windowDownloadStatus(new WDownloadStatus(d)),
m_window(c->display()->end()),
@@ -193,21 +193,21 @@ void
Download::receive_max_uploads(int t) {
m_windowDownloadStatus->mark_dirty();
m_download->get_download().set_uploads_max(std::max(m_download->get_download().get_uploads_max() + t, (uint32_t)2));
m_download->get_download().set_uploads_max(std::max(m_download->get_download().uploads_max() + t, (uint32_t)2));
}
void
Download::receive_min_peers(int t) {
m_windowDownloadStatus->mark_dirty();
m_download->get_download().set_peers_min(std::max(m_download->get_download().get_peers_min() + t, (uint32_t)5));
m_download->get_download().set_peers_min(std::max(m_download->get_download().peers_min() + t, (uint32_t)5));
}
void
Download::receive_max_peers(int t) {
m_windowDownloadStatus->mark_dirty();
m_download->get_download().set_peers_max(std::max(m_download->get_download().get_peers_max() + t, (uint32_t)5));
m_download->get_download().set_peers_max(std::max(m_download->get_download().peers_max() + t, (uint32_t)5));
}
void
@@ -224,7 +224,7 @@ Download::receive_snub_peer() {
if (m_focus == m_peers.end())
return;
m_focus->set_snubbed(!m_focus->get_snubbed());
m_focus->set_snubbed(!m_focus->is_snubbed());
mark_dirty();
}
+1 -1
View File
@@ -71,7 +71,7 @@ DownloadList::DownloadList(Control* c) :
m_window(c->display()->end()),
m_windowTitle(new WTitle("rTorrent " VERSION " - libTorrent " + std::string(torrent::get_version()))),
m_windowTitle(new WTitle("rTorrent " VERSION " - libTorrent " + std::string(torrent::version()))),
m_windowHttpQueue(new WHttp(&c->core()->get_http_queue())),
m_uiDownload(NULL),
+12 -12
View File
@@ -83,7 +83,7 @@ ElementFileList::receive_next() {
if (m_window == NULL)
throw std::logic_error("ui::ElementFileList::receive_next(...) called on a disabled object");
if (++m_focus >= m_download->get_download().get_entry_size())
if (++m_focus >= m_download->get_download().size_file_entries())
m_focus = 0;
m_window->mark_dirty();
@@ -94,13 +94,13 @@ ElementFileList::receive_prev() {
if (m_window == NULL)
throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object");
if (m_download->get_download().get_entry_size() == 0)
if (m_download->get_download().size_file_entries() == 0)
return;
if (m_focus != 0)
--m_focus;
else
m_focus = m_download->get_download().get_entry_size() - 1;
m_focus = m_download->get_download().size_file_entries() - 1;
m_window->mark_dirty();
}
@@ -110,12 +110,12 @@ ElementFileList::receive_priority() {
if (m_window == NULL)
throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object");
if (m_focus >= m_download->get_download().get_entry_size())
if (m_focus >= m_download->get_download().size_file_entries())
return;
torrent::Entry e = m_download->get_download().get_entry(m_focus);
torrent::Entry e = m_download->get_download().file_entry(m_focus);
e.set_priority(next_priority(e.get_priority()));
e.set_priority(next_priority(e.priority()));
m_download->get_download().update_priorities();
m_window->mark_dirty();
@@ -126,13 +126,13 @@ ElementFileList::receive_change_all() {
if (m_window == NULL)
throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object");
if (m_focus >= m_download->get_download().get_entry_size())
if (m_focus >= m_download->get_download().size_file_entries())
return;
Priority p = next_priority(m_download->get_download().get_entry(m_focus).get_priority());
Priority p = next_priority(m_download->get_download().file_entry(m_focus).priority());
for (int i = 0, e = m_download->get_download().get_entry_size(); i != e; ++i)
m_download->get_download().get_entry(i).set_priority(p);
for (int i = 0, e = m_download->get_download().size_file_entries(); i != e; ++i)
m_download->get_download().file_entry(i).set_priority(p);
m_download->get_download().update_priorities();
m_window->mark_dirty();
@@ -141,11 +141,11 @@ ElementFileList::receive_change_all() {
ElementFileList::Priority
ElementFileList::next_priority(Priority p) {
switch(p) {
case torrent::Entry::STOPPED:
case torrent::Entry::OFF:
return torrent::Entry::HIGH;
case torrent::Entry::NORMAL:
return torrent::Entry::STOPPED;
return torrent::Entry::OFF;
case torrent::Entry::HIGH:
return torrent::Entry::NORMAL;
+5 -5
View File
@@ -82,7 +82,7 @@ ElementTrackerList::receive_next() {
if (m_window == NULL)
throw std::logic_error("ui::ElementTrackerList::receive_next(...) called on a disabled object");
if (++m_focus >= m_download->get_download().get_tracker_size())
if (++m_focus >= m_download->get_download().size_trackers())
m_focus = 0;
m_window->mark_dirty();
@@ -93,13 +93,13 @@ ElementTrackerList::receive_prev() {
if (m_window == NULL)
throw std::logic_error("ui::ElementTrackerList::receive_prev(...) called on a disabled object");
if (m_download->get_download().get_tracker_size() == 0)
if (m_download->get_download().size_trackers() == 0)
return;
if (m_focus != 0)
--m_focus;
else
m_focus = m_download->get_download().get_tracker_size() - 1;
m_focus = m_download->get_download().size_trackers() - 1;
m_window->mark_dirty();
}
@@ -109,10 +109,10 @@ ElementTrackerList::receive_cycle_group() {
if (m_window == NULL)
throw std::logic_error("ui::ElementTrackerList::receive_group_cycle(...) called on a disabled object");
if (m_focus >= m_download->get_download().get_tracker_size())
if (m_focus >= m_download->get_download().size_trackers())
throw std::logic_error("ui::ElementTrackerList::receive_group_cycle(...) called with an invalid focus");
m_download->get_download().tracker_cycle_group(m_download->get_download().get_tracker(m_focus).get_group());
m_download->get_download().tracker_cycle_group(m_download->get_download().tracker(m_focus).group());
m_window->mark_dirty();
}
+2 -2
View File
@@ -117,7 +117,7 @@ Root::receive_down_throttle(int t) {
if (m_windowStatusbar != NULL)
m_windowStatusbar->mark_dirty();
torrent::set_down_throttle(std::max<int>(torrent::get_down_throttle() + t * 1024, 0));
torrent::set_down_throttle(std::max<int>(torrent::down_throttle() + t * 1024, 0));
}
void
@@ -125,7 +125,7 @@ Root::receive_up_throttle(int t) {
if (m_windowStatusbar != NULL)
m_windowStatusbar->mark_dirty();
uint32_t throttle = std::max<int>(torrent::get_up_throttle() + t * 1024, 0);
uint32_t throttle = std::max<int>(torrent::up_throttle() + t * 1024, 0);
torrent::set_up_throttle(throttle);