* ChunkSelector selected from outside the priority ranges due to

~(char)0 giving an inverted integer rather than char.

* Fixed a segfault due to too small screen size, snprintf returns the
number of bytes that could have been written rather than how much
actually was.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@626 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-01-24 20:05:36 +00:00
parent 825985b8ef
commit 305e3bdf2b
15 changed files with 263 additions and 127 deletions
+6
View File
@@ -234,6 +234,11 @@ Download::receive_next_priority() {
m_download->set_priority((m_download->priority() + 1) % 4);
}
void
Download::receive_prev_priority() {
m_download->set_priority((m_download->priority() - 1) % 4);
}
void
Download::bind_keys() {
(*m_bindings)['1'] = sigc::bind(sigc::mem_fun(*this, &Download::receive_max_uploads), -1);
@@ -243,6 +248,7 @@ Download::bind_keys() {
(*m_bindings)['5'] = sigc::bind(sigc::mem_fun(*this, &Download::receive_max_peers), -5);
(*m_bindings)['6'] = sigc::bind(sigc::mem_fun(*this, &Download::receive_max_peers), 5);
(*m_bindings)['+'] = sigc::mem_fun(*this, &Download::receive_next_priority);
(*m_bindings)['-'] = sigc::mem_fun(*this, &Download::receive_prev_priority);
(*m_bindings)['t'] = sigc::bind(sigc::mem_fun(m_download->get_download(), &torrent::Download::tracker_manual_request), false);
(*m_bindings)['T'] = sigc::bind(sigc::mem_fun(m_download->get_download(), &torrent::Download::tracker_manual_request), true);
+3 -2
View File
@@ -88,6 +88,9 @@ public:
void activate_display(Display d);
void disable_display();
void receive_next_priority();
void receive_prev_priority();
private:
Download(const Download&);
void operator = (const Download&);
@@ -105,8 +108,6 @@ private:
void receive_snub_peer();
void receive_next_priority();
void bind_keys();
void mark_dirty();
+18
View File
@@ -233,6 +233,22 @@ DownloadList::receive_exit_download() {
m_control->display()->adjust_layout();
}
void
DownloadList::receive_next_priority() {
if (m_downloadList.get_focus() == m_downloadList.end())
return;
(*m_downloadList.get_focus())->set_priority(((*m_downloadList.get_focus())->priority() + 1) % 4);
}
void
DownloadList::receive_prev_priority() {
if (m_downloadList.get_focus() == m_downloadList.end())
return;
(*m_downloadList.get_focus())->set_priority(((*m_downloadList.get_focus())->priority() - 1) % 4);
}
void
DownloadList::receive_check_hash() {
if (m_downloadList.get_focus() == m_downloadList.end())
@@ -304,6 +320,8 @@ DownloadList::setup_keys() {
(*m_bindings)['\x13'] = sigc::mem_fun(*this, &DownloadList::receive_start_download);
(*m_bindings)['\x04'] = sigc::mem_fun(*this, &DownloadList::receive_stop_download);
(*m_bindings)['\x12'] = sigc::mem_fun(*this, &DownloadList::receive_check_hash);
(*m_bindings)['+'] = sigc::mem_fun(*this, &DownloadList::receive_next_priority);
(*m_bindings)['-'] = sigc::mem_fun(*this, &DownloadList::receive_prev_priority);
(*m_bindings)['\x7f'] = sigc::bind(sigc::mem_fun(*this, &DownloadList::receive_view_input), true);
(*m_bindings)[KEY_BACKSPACE] = sigc::bind(sigc::mem_fun(*this, &DownloadList::receive_view_input), true);
+3
View File
@@ -115,6 +115,9 @@ private:
void receive_view_download();
void receive_exit_download();
void receive_next_priority();
void receive_prev_priority();
void receive_check_hash();
void receive_view_input(bool useDefault);