Show
Ignore:
Timestamp:
12/23/07 03:05:00 (4 years ago)
Author:
rakshasa
Message:

* 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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rtorrent/src/command_download.cc

    r1017 r1021  
    176176} 
    177177 
     178void 
     179apply_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 
    178188const char* 
    179189retrieve_d_connection_type(core::Download* download) { 
     
    508518  ADD_CD_VALUE_UNI("tracker_size",        std::mem_fun(&core::Download::tracker_list_size)); 
    509519 
    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 
    511523  ADD_CD_VALUE_BI("priority",             std::mem_fun(&core::Download::set_priority), std::mem_fun(&core::Download::priority)); 
    512524  ADD_CD_STRING_UNI("priority_str",       std::ptr_fun(&retrieve_d_priority_str));