Changeset 1021 for trunk/rtorrent/src/command_download.cc
- Timestamp:
- 12/23/07 03:05:00 (4 years ago)
- Files:
-
- 1 modified
-
trunk/rtorrent/src/command_download.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtorrent/src/command_download.cc
r1017 r1021 176 176 } 177 177 178 void 179 apply_d_directory(core::Download* download, const std::string& name) { 180 if (!download->file_list()->is_multi_file()) 181 download->set_root_directory(name); 182 else if (name.empty() || *name.rbegin() == '/') 183 download->set_root_directory(name + download->download()->name()); 184 else 185 download->set_root_directory(name + "/" + download->download()->name()); 186 } 187 178 188 const char* 179 189 retrieve_d_connection_type(core::Download* download) { … … 508 518 ADD_CD_VALUE_UNI("tracker_size", std::mem_fun(&core::Download::tracker_list_size)); 509 519 510 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))); 520 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))); 521 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))); 522 511 523 ADD_CD_VALUE_BI("priority", std::mem_fun(&core::Download::set_priority), std::mem_fun(&core::Download::priority)); 512 524 ADD_CD_STRING_UNI("priority_str", std::ptr_fun(&retrieve_d_priority_str));
