mirror of https://github.com/aria2/aria2
2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added function returning suffix of control file to DefaultBtProgressInfoFile. * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/RequestGroup.ccpull/1/head
parent
c0c12cdd81
commit
d99ec1534f
|
@ -1,3 +1,11 @@
|
|||
2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added function returning suffix of control file to
|
||||
DefaultBtProgressInfoFile.
|
||||
* src/DefaultBtProgressInfoFile.cc
|
||||
* src/DefaultBtProgressInfoFile.h
|
||||
* src/RequestGroup.cc
|
||||
|
||||
2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Documented getVersion in man page.
|
||||
|
|
|
@ -66,10 +66,11 @@ namespace aria2 {
|
|||
const std::string DefaultBtProgressInfoFile::V0000("0000");
|
||||
const std::string DefaultBtProgressInfoFile::V0001("0001");
|
||||
|
||||
static std::string createFilename(const SharedHandle<DownloadContext>& dctx)
|
||||
static std::string createFilename
|
||||
(const SharedHandle<DownloadContext>& dctx, const std::string& suffix)
|
||||
{
|
||||
std::string t = dctx->getBasePath();
|
||||
t += ".aria2";
|
||||
t += suffix;
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -81,14 +82,14 @@ DefaultBtProgressInfoFile::DefaultBtProgressInfoFile
|
|||
_pieceStorage(pieceStorage),
|
||||
_option(option),
|
||||
_logger(LogFactory::getInstance()),
|
||||
_filename(createFilename(_dctx))
|
||||
_filename(createFilename(_dctx, getSuffix()))
|
||||
{}
|
||||
|
||||
DefaultBtProgressInfoFile::~DefaultBtProgressInfoFile() {}
|
||||
|
||||
void DefaultBtProgressInfoFile::updateFilename()
|
||||
{
|
||||
_filename = createFilename(_dctx);
|
||||
_filename = createFilename(_dctx, getSuffix());
|
||||
}
|
||||
|
||||
bool DefaultBtProgressInfoFile::isTorrentDownload()
|
||||
|
|
|
@ -88,6 +88,12 @@ public:
|
|||
|
||||
void setBtRuntime(const SharedHandle<BtRuntime>& btRuntime);
|
||||
#endif // ENABLE_BITTORRENT
|
||||
|
||||
static const std::string& getSuffix()
|
||||
{
|
||||
static std::string suffix = ".aria2";
|
||||
return suffix;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -557,8 +557,7 @@ bool RequestGroup::tryAutoFileRenaming()
|
|||
}
|
||||
for(unsigned int i = 1; i < 10000; ++i) {
|
||||
File newfile(strconcat(filepath, ".", Util::uitos(i)));
|
||||
// TODO1.5 hard coded ".aria2" extension.
|
||||
File ctrlfile(newfile.getPath()+".aria2");
|
||||
File ctrlfile(newfile.getPath()+DefaultBtProgressInfoFile::getSuffix());
|
||||
if(!newfile.exists() || (newfile.exists() && ctrlfile.exists())) {
|
||||
_downloadContext->getFirstFileEntry()->setPath(newfile.getPath());
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue