--dir and --out option is now available in aria2.changeOption.

--dir and --out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
pull/2/head
Tatsuhiro Tsujikawa 2011-11-02 00:01:25 +09:00
parent 9a51cc356b
commit 701a2d6ff8
2 changed files with 11 additions and 0 deletions

View File

@ -213,6 +213,7 @@ OptionHandlerFactory::createOptionHandlers()
op->addTag(TAG_FILE);
op->setInitialOption(true);
op->setChangeGlobalOption(true);
op->setChangeOptionForReserved(true);
handlers.push_back(op);
}
{
@ -848,6 +849,7 @@ OptionHandlerFactory::createOptionHandlers()
op->addTag(TAG_HTTP);
op->addTag(TAG_FILE);
op->setInitialOption(true);
op->setChangeOptionForReserved(true);
handlers.push_back(op);
}
{

View File

@ -1147,6 +1147,15 @@ void changeOption
(*i)->setMaxConnectionPerServer(maxConn);
}
}
if(option.defined(PREF_DIR) || option.defined(PREF_OUT)) {
if(dctx->getFileEntries().size() == 1 &&
!dctx->hasAttribute(bittorrent::BITTORRENT)) {
dctx->getFirstFileEntry()->setPath
(group->getOption()->blank(PREF_OUT) ? A2STR::NIL :
util::applyDir(group->getOption()->get(PREF_DIR),
group->getOption()->get(PREF_OUT)));
}
}
if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) {
group->setMaxDownloadSpeedLimit
(option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT));