* Properly use d.set_directory_base when

* Added get_{up,down}_{rate,total}.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1023 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-12-30 04:43:05 +00:00
parent 7b053b969e
commit ce64ea89b1
8 changed files with 47 additions and 47 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ DownloadFactory::receive_success() {
if (!rtorrent->has_key_string("directory"))
rpc::call_command("d.set_directory", m_variables["directory"], rpc::make_target(download));
else
rpc::call_command("d.set_directory", rtorrent->get_key("directory"), rpc::make_target(download));
rpc::call_command("d.set_directory_base", rtorrent->get_key("directory"), rpc::make_target(download));
if (!m_session && m_variables["tied_to_file"].as_value())
rpc::call_command("d.set_tied_to_file", m_uri, rpc::make_target(download));
+2 -3
View File
@@ -157,10 +157,9 @@ DownloadStore::get_formated_entries() {
if (!is_enabled())
return utils::Directory();
utils::Directory d;
d.set_path(m_path);
utils::Directory d(m_path);
if (!d.update())
if (!d.update(utils::Directory::update_hide_dot))
throw torrent::storage_error("core::DownloadStore::update() could not open directory \"" + m_path + "\"");
d.erase(std::remove_if(d.begin(), d.end(), std::ptr_fun(&not_correct_format)), d.end());
+3 -3
View File
@@ -459,17 +459,17 @@ path_expand(std::vector<std::string>* paths, const std::string& pattern) {
for (std::vector<utils::Directory>::iterator itr = currentCache.begin(); itr != currentCache.end(); ++itr) {
// Only include filenames starting with '.' if the pattern
// starts with the same.
itr->update(r.pattern()[0] != '.');
itr->update((r.pattern()[0] != '.') ? utils::Directory::update_hide_dot : 0);
itr->erase(std::remove_if(itr->begin(), itr->end(), rak::on(rak::mem_ref(&utils::directory_entry::d_name), std::not1(r))), itr->end());
std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), rak::bind1st(std::ptr_fun(&path_expand_transform), itr->get_path() + "/"));
std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), rak::bind1st(std::ptr_fun(&path_expand_transform), itr->path() + "/"));
}
currentCache.clear();
currentCache.swap(nextCache);
}
std::transform(currentCache.begin(), currentCache.end(), std::back_inserter(*paths), std::mem_fun_ref(&utils::Directory::get_path));
std::transform(currentCache.begin(), currentCache.end(), std::back_inserter(*paths), std::mem_fun_ref(&utils::Directory::path));
}
bool