* Moved some stuff from Content into FileList.

* Resume data was not being used as it was comparing the number of
entries with size_bytes, not size_files.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@812 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-11-30 15:14:26 +00:00
parent 8b759a5c6e
commit c992fa60df
5 changed files with 22 additions and 10 deletions
+4
View File
@@ -98,6 +98,10 @@ Download::Download(download_type d) :
m_variables.insert("max_peers", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::peers_max), rak::mem_fn(&m_download, &download_type::set_peers_max)));
m_variables.insert("max_uploads", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::uploads_max), rak::mem_fn(&m_download, &download_type::set_uploads_max)));
m_variables.insert("max_file_size", new utils::VariableValueSlot(rak::mem_fn(file_list(), &file_list_type::max_file_size), rak::mem_fn(file_list(), &file_list_type::set_max_file_size)));
// m_variables.insert("split_file_size", new utils::VariableValueSlot(rak::mem_fn(file_list(), &file_list_type::split_file_size), rak::mem_fn(file_list(), &file_list_type::set_split_file_size)));
// m_variables.insert("split_suffix", new utils::VariableStringSlot(rak::mem_fn(file_list(), &file_list_type::split_suffix), rak::mem_fn(file_list(), &file_list_type::set_split_suffix)));
m_variables.insert("up_rate", new utils::VariableValueSlot(rak::mem_fn(m_download.up_rate(), &torrent::Rate::rate), NULL));
m_variables.insert("up_total", new utils::VariableValueSlot(rak::mem_fn(m_download.up_rate(), &torrent::Rate::total), NULL));
m_variables.insert("down_rate", new utils::VariableValueSlot(rak::mem_fn(m_download.down_rate(), &torrent::Rate::rate), NULL));
+3 -2
View File
@@ -51,6 +51,7 @@ namespace core {
class Download {
public:
typedef torrent::Download download_type;
typedef torrent::FileList file_list_type;
typedef torrent::TrackerList tracker_list_type;
typedef download_type::ConnectionType connection_type;
typedef utils::VariableMap variable_map_type;
@@ -85,8 +86,8 @@ public:
download_type* download() { return &m_download; }
const download_type* c_download() const { return &m_download; }
torrent::FileList* file_list() { return m_download.file_list(); }
const torrent::FileList* c_file_list() const { return m_download.file_list(); }
file_list_type* file_list() { return m_download.file_list(); }
const file_list_type* c_file_list() const { return m_download.file_list(); }
torrent::Object* bencode() { return m_download.bencode(); }
tracker_list_type* tracker_list() { return &m_trackerList; }
+9
View File
@@ -190,6 +190,15 @@ DownloadFactory::receive_success() {
if (!control->variable()->get_value("use_udp_trackers"))
download->enable_udp_trackers(false);
if (control->variable()->get_value("max_file_size") > 0)
download->variable()->set("max_file_size", control->variable()->get("max_file_size"));
// if (control->variable()->get_value("split_file_size") >= 0)
// download->variable()->set("split_file_size", control->variable()->get("split_file_size"));
// if (!control->variable()->get_string("split_suffix").empty())
// download->variable()->set("split_suffix", control->variable()->get("split_suffix"));
if (!rtorrent->has_key_string("directory"))
download->variable()->set("directory", m_variables.get("directory"));
else