From da67bdfff1b7726019d5f8beef2643c063929d21 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 26 Oct 2005 13:25:10 +0000 Subject: [PATCH] * Added prefered encoding list using the "encoding_list = " option. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@587 e378c898-3ddf-0310-93e7-cc216c733640 --- doc/rtorrent.1.xml | 11 +++++++++++ src/main.cc | 1 + src/option_handler_rules.cc | 6 ++++++ src/option_handler_rules.h | 1 + 4 files changed, 19 insertions(+) diff --git a/doc/rtorrent.1.xml b/doc/rtorrent.1.xml index 50606811..198652c5 100644 --- a/doc/rtorrent.1.xml +++ b/doc/rtorrent.1.xml @@ -394,6 +394,17 @@ + + encoding_list = encoding + + + Add a preferred filename encoding to the list. The encodings + are attempted in the order they are inserted, if none match + the torrent default is used. + + + + diff --git a/src/main.cc b/src/main.cc index c580b13d..692c3d80 100644 --- a/src/main.cc +++ b/src/main.cc @@ -142,6 +142,7 @@ initialize_option_handler(Control* c, OptionHandler* optionHandler) { optionHandler->insert("connection_seed", new OptionHandlerString(c, &apply_connection_seed, &validate_non_empty)); optionHandler->insert("session", new OptionHandlerString(c, &apply_session_directory, &validate_directory)); + optionHandler->insert("encoding_list", new OptionHandlerString(c, &apply_encoding_list, &validate_non_empty)); optionHandler->insert("tracker_dump", new OptionHandlerString(c, &apply_tracker_dump, &validate_yes_no)); optionHandler->insert("use_udp_trackers", new OptionHandlerString(c, &apply_use_udp_trackers, &validate_yes_no)); } diff --git a/src/option_handler_rules.cc b/src/option_handler_rules.cc index 58b931d3..721eb6d2 100644 --- a/src/option_handler_rules.cc +++ b/src/option_handler_rules.cc @@ -243,3 +243,9 @@ void apply_session_directory(Control* m, const std::string& arg) { m->core()->get_download_store().use(arg); } + +void +apply_encoding_list(Control* m, const std::string& arg) { + torrent::encoding_list()->push_back(arg); +} + diff --git a/src/option_handler_rules.h b/src/option_handler_rules.h index 5110c845..2b9b48b4 100644 --- a/src/option_handler_rules.h +++ b/src/option_handler_rules.h @@ -90,6 +90,7 @@ void apply_use_udp_trackers(Control* m, const std::string& arg); void apply_check_hash(Control* m, const std::string& arg); void apply_session_directory(Control* m, const std::string& arg); +void apply_encoding_list(Control* m, const std::string& arg); class OptionHandlerInt : public OptionHandlerBase { public: