* Use user-modifiable commands instead of slots for the 'on_*' events.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1070 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-10-01 14:19:51 +00:00
parent d7c2960d1e
commit 07b9616ef6
13 changed files with 332 additions and 139 deletions
+15
View File
@@ -41,6 +41,11 @@
#include <torrent/object.h>
#include <torrent/data/file_list_iterator.h>
// Get better logging...
#include "globals.h"
#include "control.h"
#include "core/manager.h"
#include "command.h"
#include "command_map.h"
@@ -99,6 +104,16 @@ CommandMap::erase(iterator itr) {
delete [] key;
}
const CommandMap::mapped_type
CommandMap::call_catch(key_type key, target_type target, const mapped_type& args, const char* err) {
try {
return call_command(key, args, target);
} catch (torrent::input_error& e) {
control->core()->push_log((err + std::string(e.what())).c_str());
return torrent::Object();
}
}
const CommandMap::mapped_type
CommandMap::call_command(key_type key, const mapped_type& arg, target_type target) {
const_iterator itr = base_type::find(key);