mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 06:02: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
-1
@@ -1012,7 +1012,7 @@ Adjust the send and receive buffer size for socket.
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>umask = <replaceable>0644</replaceable></term>
|
||||
<term>umask = <replaceable>0022</replaceable></term>
|
||||
<listitem><para>
|
||||
|
||||
Set the umask for this process, which is applied to all files created
|
||||
|
||||
+13
-1
@@ -175,6 +175,16 @@ apply_d_connection_type(core::Download* download, const std::string& name) {
|
||||
download->download()->set_connection_type(connType);
|
||||
}
|
||||
|
||||
void
|
||||
apply_d_directory(core::Download* download, const std::string& name) {
|
||||
if (!download->file_list()->is_multi_file())
|
||||
download->set_root_directory(name);
|
||||
else if (name.empty() || *name.rbegin() == '/')
|
||||
download->set_root_directory(name + download->download()->name());
|
||||
else
|
||||
download->set_root_directory(name + "/" + download->download()->name());
|
||||
}
|
||||
|
||||
const char*
|
||||
retrieve_d_connection_type(core::Download* download) {
|
||||
switch (download->download()->connection_type()) {
|
||||
@@ -507,7 +517,9 @@ initialize_command_download() {
|
||||
ADD_CD_VALUE_UNI("tracker_focus", rak::on(std::mem_fun(&core::Download::tracker_list), std::mem_fun(&torrent::TrackerList::focus_index)));
|
||||
ADD_CD_VALUE_UNI("tracker_size", std::mem_fun(&core::Download::tracker_list_size));
|
||||
|
||||
ADD_CD_STRING_BI("directory", std::mem_fun(&core::Download::set_root_directory), rak::on(std::mem_fun(&core::Download::file_list), std::mem_fun(&torrent::FileList::root_dir)));
|
||||
ADD_CD_STRING_BI("directory", std::ptr_fun(&apply_d_directory), rak::on(std::mem_fun(&core::Download::file_list), std::mem_fun(&torrent::FileList::root_dir)));
|
||||
ADD_CD_STRING_BI("directory_base", std::mem_fun(&core::Download::set_root_directory), rak::on(std::mem_fun(&core::Download::file_list), std::mem_fun(&torrent::FileList::root_dir)));
|
||||
|
||||
ADD_CD_VALUE_BI("priority", std::mem_fun(&core::Download::set_priority), std::mem_fun(&core::Download::priority));
|
||||
ADD_CD_STRING_UNI("priority_str", std::ptr_fun(&retrieve_d_priority_str));
|
||||
|
||||
|
||||
+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