/* */ #include "TorrentDownloadEngine.h" void TorrentDownloadEngine::onEndOfRun() { torrentMan->diskAdaptor->closeFile(); if(filenameFixed && torrentMan->downloadComplete()) { torrentMan->remove(); } else { torrentMan->save(); } } void TorrentDownloadEngine::afterEachIteration() { if(!filenameFixed && torrentMan->downloadComplete()) { if(torrentMan->isSelectiveDownloadingMode()) { onSelectiveDownloadingCompletes(); } torrentMan->onDownloadComplete(); if(torrentMan->downloadComplete()) { filenameFixed = true; } } }