* Added "d.set_directory_base" command that handles single and multi

file torrent equally.

* Fixed man page entry on 'umask', it should be 0022 not 0664.

* Cleaned up File and FileList classes.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1021 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-12-23 08:05:00 +00:00
parent 51e27e29c8
commit ccb3713a57
3 changed files with 15 additions and 14 deletions
+1 -12
View File
@@ -155,23 +155,12 @@ Download::receive_chunk_failed(__UNUSED uint32_t idx) {
m_chunksFailed++;
}
// Clean up.
void
Download::set_root_directory(const std::string& path) {
torrent::FileList* fileList = m_download.file_list();
control->core()->download_list()->close_directly(this);
if (path.empty()) {
fileList->set_root_dir("./" + (fileList->is_multi_file() ? m_download.name() : std::string()));
} else {
std::string fullPath = rak::path_expand(path);
fileList->set_root_dir(fullPath +
(*fullPath.rbegin() != '/' ? "/" : "") +
(fileList->is_multi_file() ? m_download.name() : std::string()));
}
fileList->set_root_dir(rak::path_expand(path));
bencode()->get_key("rtorrent").insert_key("directory", path);
}