C++11 compatibility fixes.

This commit is contained in:
rakshasa
2014-05-13 23:36:37 +09:00
parent e42ec54920
commit 3b39f37f49
77 changed files with 886 additions and 803 deletions
+51 -51
View File
@@ -84,13 +84,13 @@ Download::Download(core::Download* d) :
m_uiArray[DISPLAY_CHUNKS_SEEN] = new ElementChunksSeen(d);
m_uiArray[DISPLAY_TRANSFER_LIST] = new ElementTransferList(d);
m_uiArray[DISPLAY_MENU]->slot_exit(std::tr1::bind(&slot_type::operator(), &m_slot_exit));
m_uiArray[DISPLAY_PEER_LIST]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_PEER_LIST));
m_uiArray[DISPLAY_INFO]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_INFO));
m_uiArray[DISPLAY_FILE_LIST]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_FILE_LIST));
m_uiArray[DISPLAY_TRACKER_LIST]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_TRACKER_LIST));
m_uiArray[DISPLAY_CHUNKS_SEEN]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_CHUNKS_SEEN));
m_uiArray[DISPLAY_TRANSFER_LIST]->slot_exit(std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_TRANSFER_LIST));
m_uiArray[DISPLAY_MENU]->slot_exit(std::bind(&slot_type::operator(), &m_slot_exit));
m_uiArray[DISPLAY_PEER_LIST]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_PEER_LIST));
m_uiArray[DISPLAY_INFO]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_INFO));
m_uiArray[DISPLAY_FILE_LIST]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_FILE_LIST));
m_uiArray[DISPLAY_TRACKER_LIST]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_TRACKER_LIST));
m_uiArray[DISPLAY_CHUNKS_SEEN]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_CHUNKS_SEEN));
m_uiArray[DISPLAY_TRANSFER_LIST]->slot_exit(std::bind(&Download::activate_display_menu, this, DISPLAY_TRANSFER_LIST));
bind_keys();
}
@@ -109,30 +109,30 @@ Download::create_menu() {
ElementMenu* element = new ElementMenu;
element->push_back("Peer list",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_PEER_LIST),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_PEER_LIST));
std::bind(&Download::activate_display_focus, this, DISPLAY_PEER_LIST),
std::bind(&Download::activate_display_menu, this, DISPLAY_PEER_LIST));
element->push_back("Info",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_INFO),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_INFO));
std::bind(&Download::activate_display_focus, this, DISPLAY_INFO),
std::bind(&Download::activate_display_menu, this, DISPLAY_INFO));
element->push_back("File list",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_FILE_LIST),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_FILE_LIST));
std::bind(&Download::activate_display_focus, this, DISPLAY_FILE_LIST),
std::bind(&Download::activate_display_menu, this, DISPLAY_FILE_LIST));
element->push_back("Tracker list",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_TRACKER_LIST),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_TRACKER_LIST));
std::bind(&Download::activate_display_focus, this, DISPLAY_TRACKER_LIST),
std::bind(&Download::activate_display_menu, this, DISPLAY_TRACKER_LIST));
element->push_back("Chunks seen",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_CHUNKS_SEEN),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_CHUNKS_SEEN));
std::bind(&Download::activate_display_focus, this, DISPLAY_CHUNKS_SEEN),
std::bind(&Download::activate_display_menu, this, DISPLAY_CHUNKS_SEEN));
element->push_back("Transfer list",
std::tr1::bind(&Download::activate_display_focus, this, DISPLAY_TRANSFER_LIST),
std::tr1::bind(&Download::activate_display_menu, this, DISPLAY_TRANSFER_LIST));
std::bind(&Download::activate_display_focus, this, DISPLAY_TRANSFER_LIST),
std::bind(&Download::activate_display_menu, this, DISPLAY_TRANSFER_LIST));
element->set_entry(0, false);
m_bindings['p'] = std::tr1::bind(&ElementMenu::set_entry_trigger, element, 0);
m_bindings['o'] = std::tr1::bind(&ElementMenu::set_entry_trigger, element, 1);
m_bindings['i'] = std::tr1::bind(&ElementMenu::set_entry_trigger, element, 2);
m_bindings['u'] = std::tr1::bind(&ElementMenu::set_entry_trigger, element, 3);
m_bindings['p'] = std::bind(&ElementMenu::set_entry_trigger, element, 0);
m_bindings['o'] = std::bind(&ElementMenu::set_entry_trigger, element, 1);
m_bindings['i'] = std::bind(&ElementMenu::set_entry_trigger, element, 2);
m_bindings['u'] = std::bind(&ElementMenu::set_entry_trigger, element, 3);
return element;
}
@@ -375,40 +375,40 @@ Download::adjust_up_throttle(int throttle) {
void
Download::bind_keys() {
m_bindings['1'] = std::tr1::bind(&Download::receive_min_uploads, this, -1);
m_bindings['2'] = std::tr1::bind(&Download::receive_min_uploads, this, 1);
m_bindings['3'] = std::tr1::bind(&Download::receive_max_uploads, this, -1);
m_bindings['4'] = std::tr1::bind(&Download::receive_max_uploads, this, 1);
m_bindings['!'] = std::tr1::bind(&Download::receive_min_downloads, this, -1);
m_bindings['@'] = std::tr1::bind(&Download::receive_min_downloads, this, 1);
m_bindings['#'] = std::tr1::bind(&Download::receive_max_downloads, this, -1);
m_bindings['$'] = std::tr1::bind(&Download::receive_max_downloads, this, 1);
m_bindings['5'] = std::tr1::bind(&Download::receive_min_peers, this, -5);
m_bindings['6'] = std::tr1::bind(&Download::receive_min_peers, this, 5);
m_bindings['7'] = std::tr1::bind(&Download::receive_max_peers, this, -5);
m_bindings['8'] = std::tr1::bind(&Download::receive_max_peers, this, 5);
m_bindings['+'] = std::tr1::bind(&Download::receive_next_priority, this);
m_bindings['-'] = std::tr1::bind(&Download::receive_prev_priority, this);
m_bindings['1'] = std::bind(&Download::receive_min_uploads, this, -1);
m_bindings['2'] = std::bind(&Download::receive_min_uploads, this, 1);
m_bindings['3'] = std::bind(&Download::receive_max_uploads, this, -1);
m_bindings['4'] = std::bind(&Download::receive_max_uploads, this, 1);
m_bindings['!'] = std::bind(&Download::receive_min_downloads, this, -1);
m_bindings['@'] = std::bind(&Download::receive_min_downloads, this, 1);
m_bindings['#'] = std::bind(&Download::receive_max_downloads, this, -1);
m_bindings['$'] = std::bind(&Download::receive_max_downloads, this, 1);
m_bindings['5'] = std::bind(&Download::receive_min_peers, this, -5);
m_bindings['6'] = std::bind(&Download::receive_min_peers, this, 5);
m_bindings['7'] = std::bind(&Download::receive_max_peers, this, -5);
m_bindings['8'] = std::bind(&Download::receive_max_peers, this, 5);
m_bindings['+'] = std::bind(&Download::receive_next_priority, this);
m_bindings['-'] = std::bind(&Download::receive_prev_priority, this);
m_bindings['t'] = std::tr1::bind(&torrent::Download::manual_request, m_download->download(), false);
m_bindings['T'] = std::tr1::bind(&torrent::Download::manual_request, m_download->download(), true);
m_bindings['t'] = std::bind(&torrent::Download::manual_request, m_download->download(), false);
m_bindings['T'] = std::bind(&torrent::Download::manual_request, m_download->download(), true);
const char* keys = control->ui()->get_throttle_keys();
m_bindings[keys[ 0]] = std::tr1::bind(&Download::adjust_up_throttle, this, 1);
m_bindings[keys[ 1]] = std::tr1::bind(&Download::adjust_up_throttle, this, -1);
m_bindings[keys[ 2]] = std::tr1::bind(&Download::adjust_down_throttle, this, 1);
m_bindings[keys[ 3]] = std::tr1::bind(&Download::adjust_down_throttle, this, -1);
m_bindings[keys[ 0]] = std::bind(&Download::adjust_up_throttle, this, 1);
m_bindings[keys[ 1]] = std::bind(&Download::adjust_up_throttle, this, -1);
m_bindings[keys[ 2]] = std::bind(&Download::adjust_down_throttle, this, 1);
m_bindings[keys[ 3]] = std::bind(&Download::adjust_down_throttle, this, -1);
m_bindings[keys[ 4]] = std::tr1::bind(&Download::adjust_up_throttle, this, 5);
m_bindings[keys[ 5]] = std::tr1::bind(&Download::adjust_up_throttle, this, -5);
m_bindings[keys[ 6]] = std::tr1::bind(&Download::adjust_down_throttle, this, 5);
m_bindings[keys[ 7]] = std::tr1::bind(&Download::adjust_down_throttle, this, -5);
m_bindings[keys[ 4]] = std::bind(&Download::adjust_up_throttle, this, 5);
m_bindings[keys[ 5]] = std::bind(&Download::adjust_up_throttle, this, -5);
m_bindings[keys[ 6]] = std::bind(&Download::adjust_down_throttle, this, 5);
m_bindings[keys[ 7]] = std::bind(&Download::adjust_down_throttle, this, -5);
m_bindings[keys[ 8]] = std::tr1::bind(&Download::adjust_up_throttle, this, 50);
m_bindings[keys[ 9]] = std::tr1::bind(&Download::adjust_up_throttle, this, -50);
m_bindings[keys[10]] = std::tr1::bind(&Download::adjust_down_throttle, this, 50);
m_bindings[keys[11]] = std::tr1::bind(&Download::adjust_down_throttle, this, -50);
m_bindings[keys[ 8]] = std::bind(&Download::adjust_up_throttle, this, 50);
m_bindings[keys[ 9]] = std::bind(&Download::adjust_up_throttle, this, -50);
m_bindings[keys[10]] = std::bind(&Download::adjust_down_throttle, this, 50);
m_bindings[keys[11]] = std::bind(&Download::adjust_down_throttle, this, -50);
}
}
+19 -19
View File
@@ -191,7 +191,7 @@ DownloadList::activate_display(Display displayType) {
Download* download = new Download(*current_view()->focus());
download->activate(m_frame);
download->slot_exit(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD_LIST));
download->slot_exit(std::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD_LIST));
m_uiArray[DISPLAY_DOWNLOAD] = download;
break;
@@ -268,18 +268,18 @@ DownloadList::receive_view_input(Input type) {
ElementStringList* esl = dynamic_cast<ElementStringList*>(m_uiArray[DISPLAY_STRING_LIST]);
input->signal_show_next().push_back(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
input->signal_show_next().push_back(std::tr1::bind(&ElementStringList::next_screen, esl));
input->signal_show_next().push_back(std::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
input->signal_show_next().push_back(std::bind(&ElementStringList::next_screen, esl));
input->signal_show_range().push_back(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
input->signal_show_range().push_back(std::tr1::bind(&ElementStringList::set_range_dirent<utils::Directory::iterator>,
input->signal_show_range().push_back(std::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
input->signal_show_range().push_back(std::bind(&ElementStringList::set_range_dirent<utils::Directory::iterator>,
esl,
std::tr1::placeholders::_1,
std::tr1::placeholders::_2));
std::placeholders::_1,
std::placeholders::_2));
input->bindings()['\n'] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()[KEY_ENTER] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()['\x07'] = std::tr1::bind(&DownloadList::receive_exit_input, this, INPUT_NONE);
input->bindings()['\n'] = std::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()[KEY_ENTER] = std::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()['\x07'] = std::bind(&DownloadList::receive_exit_input, this, INPUT_NONE);
control->ui()->enable_input(title, input);
}
@@ -340,20 +340,20 @@ DownloadList::receive_exit_input(Input type) {
void
DownloadList::setup_keys() {
m_bindings['\x7f'] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_DEFAULT);
m_bindings[KEY_BACKSPACE] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_DEFAULT);
m_bindings['\n'] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_MODIFIED);
m_bindings[KEY_ENTER] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_MODIFIED);
m_bindings['\x0F'] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_CHANGE_DIRECTORY);
m_bindings['X' - '@'] = std::tr1::bind(&DownloadList::receive_view_input, this, INPUT_COMMAND);
m_bindings['\x7f'] = std::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_DEFAULT);
m_bindings[KEY_BACKSPACE] = std::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_DEFAULT);
m_bindings['\n'] = std::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_MODIFIED);
m_bindings[KEY_ENTER] = std::bind(&DownloadList::receive_view_input, this, INPUT_LOAD_MODIFIED);
m_bindings['\x0F'] = std::bind(&DownloadList::receive_view_input, this, INPUT_CHANGE_DIRECTORY);
m_bindings['X' - '@'] = std::bind(&DownloadList::receive_view_input, this, INPUT_COMMAND);
m_uiArray[DISPLAY_LOG]->bindings()[KEY_LEFT] =
m_uiArray[DISPLAY_LOG]->bindings()['B' - '@'] =
m_uiArray[DISPLAY_LOG]->bindings()[' '] = std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD_LIST);
m_uiArray[DISPLAY_LOG]->bindings()[' '] = std::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD_LIST);
m_uiArray[DISPLAY_DOWNLOAD_LIST]->bindings()[KEY_RIGHT] =
m_uiArray[DISPLAY_DOWNLOAD_LIST]->bindings()['F' - '@'] = std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD);
m_uiArray[DISPLAY_DOWNLOAD_LIST]->bindings()['l'] = std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_LOG);
m_uiArray[DISPLAY_DOWNLOAD_LIST]->bindings()['F' - '@'] = std::bind(&DownloadList::activate_display, this, DISPLAY_DOWNLOAD);
m_uiArray[DISPLAY_DOWNLOAD_LIST]->bindings()['l'] = std::bind(&DownloadList::activate_display, this, DISPLAY_LOG);
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ public:
typedef display::WindowLog WLog;
typedef display::WindowLogComplete WLogComplete;
typedef std::tr1::function<void (const std::string&)> slot_string;
typedef std::function<void (const std::string&)> slot_string;
typedef enum {
DISPLAY_DOWNLOAD,
+1 -1
View File
@@ -48,7 +48,7 @@ namespace ui {
class ElementBase {
public:
typedef std::tr1::function<void ()> slot_type;
typedef std::function<void ()> slot_type;
ElementBase() : m_frame(NULL), m_focus(false) {}
virtual ~ElementBase() {}
+5 -5
View File
@@ -52,12 +52,12 @@ ElementChunksSeen::ElementChunksSeen(core::Download* d) :
m_window(NULL),
m_focus(0) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementChunksSeen::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementChunksSeen::receive_prev, this);
m_bindings[KEY_NPAGE] = std::tr1::bind(&ElementChunksSeen::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::tr1::bind(&ElementChunksSeen::receive_pageprev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementChunksSeen::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementChunksSeen::receive_prev, this);
m_bindings[KEY_NPAGE] = std::bind(&ElementChunksSeen::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::bind(&ElementChunksSeen::receive_pageprev, this);
}
void
+23 -23
View File
@@ -63,42 +63,42 @@ ElementDownloadList::ElementDownloadList() :
if (m_view == NULL)
throw torrent::internal_error("View \"main\" must be present to initialize the main display.");
m_bindings['\x13'] = std::tr1::bind(&ElementDownloadList::receive_command, this, "d.start=");
m_bindings['\x04'] = std::tr1::bind(&ElementDownloadList::receive_command, this, "branch=d.state=,d.stop=,d.erase=");
m_bindings['\x0B'] = std::tr1::bind(&ElementDownloadList::receive_command, this, "d.ignore_commands.set=1; d.stop=; d.close=");
m_bindings['\x12'] = std::tr1::bind(&ElementDownloadList::receive_command, this, "d.complete.set=0; d.check_hash=");
m_bindings['\x05'] = std::tr1::bind(&ElementDownloadList::receive_command, this,
m_bindings['\x13'] = std::bind(&ElementDownloadList::receive_command, this, "d.start=");
m_bindings['\x04'] = std::bind(&ElementDownloadList::receive_command, this, "branch=d.state=,d.stop=,d.erase=");
m_bindings['\x0B'] = std::bind(&ElementDownloadList::receive_command, this, "d.ignore_commands.set=1; d.stop=; d.close=");
m_bindings['\x12'] = std::bind(&ElementDownloadList::receive_command, this, "d.complete.set=0; d.check_hash=");
m_bindings['\x05'] = std::bind(&ElementDownloadList::receive_command, this,
"f.multicall=,f.set_create_queued=0,f.set_resize_queued=0; print=\"Queued create/resize of files in torrent.\"");
m_bindings['+'] = std::tr1::bind(&ElementDownloadList::receive_next_priority, this);
m_bindings['-'] = std::tr1::bind(&ElementDownloadList::receive_prev_priority, this);
m_bindings['T'-'@']= std::tr1::bind(&ElementDownloadList::receive_cycle_throttle, this);
m_bindings['I'] = std::tr1::bind(&ElementDownloadList::receive_command, this,
m_bindings['+'] = std::bind(&ElementDownloadList::receive_next_priority, this);
m_bindings['-'] = std::bind(&ElementDownloadList::receive_prev_priority, this);
m_bindings['T'-'@']= std::bind(&ElementDownloadList::receive_cycle_throttle, this);
m_bindings['I'] = std::bind(&ElementDownloadList::receive_command, this,
"branch=d.ignore_commands=,"
"{d.ignore_commands.set=0, print=\"Torrent set to heed commands.\"},"
"{d.ignore_commands.set=1, print=\"Torrent set to ignore commands.\"}");
m_bindings['B'-'@']= std::tr1::bind(&ElementDownloadList::receive_command, this,
m_bindings['B'-'@']= std::bind(&ElementDownloadList::receive_command, this,
"branch=d.is_active=,"
"{print=\"Cannot enable initial seeding on an active download.\"},"
"{d.connection_seed.set=initial_seed, print=\"Enabled initial seeding for the selected download.\"}");
m_bindings['U'] = std::tr1::bind(&ElementDownloadList::receive_command, this,
m_bindings['U'] = std::bind(&ElementDownloadList::receive_command, this,
"d.delete_tied=; print=\"Cleared tied to file association for the selected download.\"");
// These should also be commands.
m_bindings['1'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "main");
m_bindings['2'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "name");
m_bindings['3'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "started");
m_bindings['4'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "stopped");
m_bindings['5'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "complete");
m_bindings['6'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "incomplete");
m_bindings['7'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "hashing");
m_bindings['8'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "seeding");
m_bindings['9'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "leeching");
m_bindings['0'] = std::tr1::bind(&ElementDownloadList::receive_change_view, this, "active");
m_bindings['1'] = std::bind(&ElementDownloadList::receive_change_view, this, "main");
m_bindings['2'] = std::bind(&ElementDownloadList::receive_change_view, this, "name");
m_bindings['3'] = std::bind(&ElementDownloadList::receive_change_view, this, "started");
m_bindings['4'] = std::bind(&ElementDownloadList::receive_change_view, this, "stopped");
m_bindings['5'] = std::bind(&ElementDownloadList::receive_change_view, this, "complete");
m_bindings['6'] = std::bind(&ElementDownloadList::receive_change_view, this, "incomplete");
m_bindings['7'] = std::bind(&ElementDownloadList::receive_change_view, this, "hashing");
m_bindings['8'] = std::bind(&ElementDownloadList::receive_change_view, this, "seeding");
m_bindings['9'] = std::bind(&ElementDownloadList::receive_change_view, this, "leeching");
m_bindings['0'] = std::bind(&ElementDownloadList::receive_change_view, this, "active");
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementDownloadList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementDownloadList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementDownloadList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementDownloadList::receive_next, this);
}
void
+10 -10
View File
@@ -63,17 +63,17 @@ ElementFileList::ElementFileList(core::Download* d) :
m_selected(iterator(d->download()->file_list()->begin())),
m_collapsed(false) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::tr1::bind(&ElementFileList::receive_select, this);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::bind(&ElementFileList::receive_select, this);
m_bindings[' '] = std::tr1::bind(&ElementFileList::receive_priority, this);
m_bindings['*'] = std::tr1::bind(&ElementFileList::receive_change_all, this);
m_bindings['/'] = std::tr1::bind(&ElementFileList::receive_collapse, this);
m_bindings[KEY_NPAGE] = std::tr1::bind(&ElementFileList::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::tr1::bind(&ElementFileList::receive_pageprev, this);
m_bindings[' '] = std::bind(&ElementFileList::receive_priority, this);
m_bindings['*'] = std::bind(&ElementFileList::receive_change_all, this);
m_bindings['/'] = std::bind(&ElementFileList::receive_collapse, this);
m_bindings[KEY_NPAGE] = std::bind(&ElementFileList::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::bind(&ElementFileList::receive_pageprev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementFileList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementFileList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementFileList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementFileList::receive_prev, this);
}
inline ElementText*
@@ -117,7 +117,7 @@ ElementFileList::activate(display::Frame* frame, bool focus) {
m_window->set_focused(focus);
m_elementInfo = element_file_list_create_info();
m_elementInfo->slot_exit(std::tr1::bind(&ElementFileList::activate_display, this, DISPLAY_LIST));
m_elementInfo->slot_exit(std::bind(&ElementFileList::activate_display, this, DISPLAY_LIST));
m_elementInfo->set_target(rpc::make_target(&m_selected));
m_frame = frame;
+2 -2
View File
@@ -54,9 +54,9 @@ ElementLogComplete::ElementLogComplete(torrent::log_buffer* l) :
m_window(NULL),
m_log(l) {
unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&ElementLogComplete::received_update, this));
unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::bind(&ElementLogComplete::received_update, this));
m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
m_log->lock_and_set_update_slot(std::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
}
void
+4 -4
View File
@@ -72,11 +72,11 @@ ElementMenu::ElementMenu() :
m_entry(entry_invalid) {
// Move bindings into a function that defines default bindings.
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::tr1::bind(&ElementMenu::entry_select, this);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::bind(&ElementMenu::entry_select, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementMenu::entry_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementMenu::entry_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementMenu::entry_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementMenu::entry_next, this);
}
ElementMenu::~ElementMenu() {
+2 -2
View File
@@ -51,8 +51,8 @@ namespace ui {
struct ElementMenuEntry {
display::TextElementStringBase* m_element;
std::tr1::function<void ()> m_slotFocus;
std::tr1::function<void ()> m_slotSelect;
std::function<void ()> m_slotFocus;
std::function<void ()> m_slotSelect;
};
class ElementMenu : public ElementBase, public std::vector<ElementMenuEntry> {
+10 -10
View File
@@ -67,23 +67,23 @@ ElementPeerList::ElementPeerList(core::Download* d) :
torrent::ConnectionList* connection_list = m_download->download()->connection_list();
m_peer_connected = connection_list->signal_connected().insert(connection_list->signal_connected().end(),
tr1::bind(&ElementPeerList::receive_peer_connected, this, tr1::placeholders::_1));
std::bind(&ElementPeerList::receive_peer_connected, this, std::placeholders::_1));
m_peer_disconnected = connection_list->signal_disconnected().insert(connection_list->signal_disconnected().end(),
tr1::bind(&ElementPeerList::receive_peer_disconnected, this, tr1::placeholders::_1));
std::bind(&ElementPeerList::receive_peer_disconnected, this, std::placeholders::_1));
m_windowList = new display::WindowPeerList(m_download, &m_list, &m_listItr);
m_elementInfo = create_info();
m_elementInfo->slot_exit(std::tr1::bind(&ElementPeerList::activate_display, this, DISPLAY_LIST));
m_elementInfo->slot_exit(std::bind(&ElementPeerList::activate_display, this, DISPLAY_LIST));
m_bindings['k'] = std::tr1::bind(&ElementPeerList::receive_disconnect_peer, this);
m_bindings['*'] = std::tr1::bind(&ElementPeerList::receive_snub_peer, this);
m_bindings['B'] = std::tr1::bind(&ElementPeerList::receive_ban_peer, this);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::tr1::bind(&ElementPeerList::activate_display, this, DISPLAY_INFO);
m_bindings['k'] = std::bind(&ElementPeerList::receive_disconnect_peer, this);
m_bindings['*'] = std::bind(&ElementPeerList::receive_snub_peer, this);
m_bindings['B'] = std::bind(&ElementPeerList::receive_ban_peer, this);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::bind(&ElementPeerList::activate_display, this, DISPLAY_INFO);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementPeerList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementPeerList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementPeerList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementPeerList::receive_next, this);
}
ElementPeerList::~ElementPeerList() {
+4 -4
View File
@@ -54,11 +54,11 @@ ElementText::ElementText(rpc::target_type target) :
m_columnWidth(0) {
// Move bindings into a function that defines default bindings.
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
// m_bindings[KEY_UP] = std::tr1::bind(this, &ElementText::entry_prev);
// m_bindings[KEY_DOWN] = std::tr1::bind(this, &ElementText::entry_next);
// m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::tr1::bind(this, &ElementText::entry_select);
// m_bindings[KEY_UP] = std::bind(this, &ElementText::entry_prev);
// m_bindings[KEY_DOWN] = std::bind(this, &ElementText::entry_next);
// m_bindings[KEY_RIGHT] = m_bindings['F' - '@'] = std::bind(this, &ElementText::entry_select);
}
ElementText::~ElementText() {
+5 -5
View File
@@ -54,13 +54,13 @@ ElementTrackerList::ElementTrackerList(core::Download* d) :
m_window(NULL),
m_focus(0) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[' '] = std::tr1::bind(&ElementTrackerList::receive_cycle_group, this);
m_bindings['*'] = std::tr1::bind(&ElementTrackerList::receive_disable, this);
m_bindings[' '] = std::bind(&ElementTrackerList::receive_cycle_group, this);
m_bindings['*'] = std::bind(&ElementTrackerList::receive_disable, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::tr1::bind(&ElementTrackerList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::tr1::bind(&ElementTrackerList::receive_prev, this);
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = std::bind(&ElementTrackerList::receive_next, this);
m_bindings[KEY_UP] = m_bindings['P' - '@'] = std::bind(&ElementTrackerList::receive_prev, this);
}
void
+5 -5
View File
@@ -52,12 +52,12 @@ ElementTransferList::ElementTransferList(core::Download* d) :
m_window(NULL),
m_focus(0) {
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::tr1::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = std::bind(&slot_type::operator(), &m_slot_exit);
m_bindings[KEY_DOWN] = std::tr1::bind(&ElementTransferList::receive_next, this);
m_bindings[KEY_UP] = std::tr1::bind(&ElementTransferList::receive_prev, this);
m_bindings[KEY_NPAGE] = std::tr1::bind(&ElementTransferList::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::tr1::bind(&ElementTransferList::receive_pageprev, this);
m_bindings[KEY_DOWN] = std::bind(&ElementTransferList::receive_next, this);
m_bindings[KEY_UP] = std::bind(&ElementTransferList::receive_prev, this);
m_bindings[KEY_NPAGE] = std::bind(&ElementTransferList::receive_pagenext, this);
m_bindings[KEY_PPAGE] = std::bind(&ElementTransferList::receive_pageprev, this);
}
void
+17 -17
View File
@@ -140,23 +140,23 @@ Root::setup_keys() {
const char* keys = get_throttle_keys();
m_bindings[keys[ 0]] = std::tr1::bind(&Root::adjust_up_throttle, this, 1);
m_bindings[keys[ 1]] = std::tr1::bind(&Root::adjust_up_throttle, this, -1);
m_bindings[keys[ 2]] = std::tr1::bind(&Root::adjust_down_throttle, this, 1);
m_bindings[keys[ 3]] = std::tr1::bind(&Root::adjust_down_throttle, this, -1);
m_bindings[keys[ 0]] = std::bind(&Root::adjust_up_throttle, this, 1);
m_bindings[keys[ 1]] = std::bind(&Root::adjust_up_throttle, this, -1);
m_bindings[keys[ 2]] = std::bind(&Root::adjust_down_throttle, this, 1);
m_bindings[keys[ 3]] = std::bind(&Root::adjust_down_throttle, this, -1);
m_bindings[keys[ 4]] = std::tr1::bind(&Root::adjust_up_throttle, this, 5);
m_bindings[keys[ 5]] = std::tr1::bind(&Root::adjust_up_throttle, this, -5);
m_bindings[keys[ 6]] = std::tr1::bind(&Root::adjust_down_throttle, this, 5);
m_bindings[keys[ 7]] = std::tr1::bind(&Root::adjust_down_throttle, this, -5);
m_bindings[keys[ 4]] = std::bind(&Root::adjust_up_throttle, this, 5);
m_bindings[keys[ 5]] = std::bind(&Root::adjust_up_throttle, this, -5);
m_bindings[keys[ 6]] = std::bind(&Root::adjust_down_throttle, this, 5);
m_bindings[keys[ 7]] = std::bind(&Root::adjust_down_throttle, this, -5);
m_bindings[keys[ 8]] = std::tr1::bind(&Root::adjust_up_throttle, this, 50);
m_bindings[keys[ 9]] = std::tr1::bind(&Root::adjust_up_throttle, this, -50);
m_bindings[keys[10]] = std::tr1::bind(&Root::adjust_down_throttle, this, 50);
m_bindings[keys[11]] = std::tr1::bind(&Root::adjust_down_throttle, this, -50);
m_bindings[keys[ 8]] = std::bind(&Root::adjust_up_throttle, this, 50);
m_bindings[keys[ 9]] = std::bind(&Root::adjust_up_throttle, this, -50);
m_bindings[keys[10]] = std::bind(&Root::adjust_down_throttle, this, 50);
m_bindings[keys[11]] = std::bind(&Root::adjust_down_throttle, this, -50);
m_bindings['\x0C'] = std::tr1::bind(&display::Manager::force_redraw, m_control->display()); // ^L
m_bindings['\x11'] = std::tr1::bind(&Control::receive_normal_shutdown, m_control); // ^Q
m_bindings['\x0C'] = std::bind(&display::Manager::force_redraw, m_control->display()); // ^L
m_bindings['\x11'] = std::bind(&Control::receive_normal_shutdown, m_control); // ^Q
}
void
@@ -234,7 +234,7 @@ Root::enable_input(const std::string& title, input::TextInput* input) {
if (m_windowInput->input() != NULL)
throw torrent::internal_error("Root::enable_input(...) m_windowInput->input() != NULL.");
input->slot_dirty(std::tr1::bind(&WInput::mark_dirty, m_windowInput));
input->slot_dirty(std::bind(&WInput::mark_dirty, m_windowInput));
m_windowStatusbar->set_active(false);
@@ -243,8 +243,8 @@ Root::enable_input(const std::string& title, input::TextInput* input) {
m_windowInput->set_title(title);
m_windowInput->set_focus(true);
input->bindings()['\x0C'] = std::tr1::bind(&display::Manager::force_redraw, m_control->display()); // ^L
input->bindings()['\x11'] = std::tr1::bind(&Control::receive_normal_shutdown, m_control); // ^Q
input->bindings()['\x0C'] = std::bind(&display::Manager::force_redraw, m_control->display()); // ^L
input->bindings()['\x11'] = std::bind(&Control::receive_normal_shutdown, m_control); // ^Q
control->input()->set_text_input(input);
control->display()->adjust_layout();