* 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
+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);