mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 03:02:30 +00:00
* 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user