mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* 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:
+1
-12
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user