mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 06:39:23 +00:00
* Make VariableMap handle both global and core::Download
variables. Variable now has functions for both void and core::Download*, where the core::Download* is discarded if necessary. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@847 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -93,7 +93,7 @@ te_string(Return (torrent::FileList::*fptr)() const, int flags = TextElementStri
|
||||
|
||||
inline TextElementStringBase*
|
||||
te_variable_string(const std::string& variable, int flags = TextElementStringBase::flag_normal, int attributes = Attributes::a_invalid) {
|
||||
return text_element_string_slot(rak::bind2nd(std::mem_fun(&core::Download::variable_string), variable), flags, attributes);
|
||||
return text_element_string_slot(rak::bind2nd(std::mem_fun(&core::Download::get_std_string), variable), flags, attributes);
|
||||
}
|
||||
|
||||
// Value stuff:
|
||||
@@ -118,7 +118,7 @@ te_value(Return (torrent::File::*fptr)() const, int flags = TextElementValueBase
|
||||
|
||||
inline TextElementValueBase*
|
||||
te_variable_value(const std::string& variable, int flags = TextElementValueBase::flag_normal, int attributes = Attributes::a_invalid) {
|
||||
return text_element_value_slot(rak::bind2nd(std::mem_fun(&core::Download::variable_value), variable), flags, attributes);
|
||||
return text_element_value_slot(rak::bind2nd(std::mem_fun(&core::Download::get_std_value), variable), flags, attributes);
|
||||
}
|
||||
|
||||
template <typename Return>
|
||||
|
||||
@@ -158,8 +158,8 @@ print_download_info(char* first, char* last, core::Download* d) {
|
||||
}
|
||||
|
||||
first = print_buffer(first, last, " [%c%c R: %3.2f",
|
||||
d->variable()->get_string("tied_to_file").empty() ? ' ' : 'T',
|
||||
d->variable()->get_value("ignore_commands") == 0 ? ' ' : 'I',
|
||||
d->get_string("tied_to_file").empty() ? ' ' : 'T',
|
||||
d->get_value("ignore_commands") == 0 ? ' ' : 'I',
|
||||
d->download()->bytes_done() > 0 ? (double)(100 * d->download()->up_rate()->total() / d->download()->bytes_done()) / 100 : 0.0);
|
||||
|
||||
if (d->priority() != 2)
|
||||
@@ -177,7 +177,7 @@ char*
|
||||
print_download_status(char* first, char* last, core::Download* d) {
|
||||
if (d->is_active())
|
||||
;
|
||||
else if (d->variable_value("hashing") != 0)
|
||||
else if (d->get_value("hashing") != 0)
|
||||
first = print_buffer(first, last, "Hashing: ");
|
||||
else if (!d->is_active())
|
||||
first = print_buffer(first, last, "Inactive: ");
|
||||
|
||||
Reference in New Issue
Block a user