/* */ #include "TorrentAutoSaveCommand.h" #include "Util.h" TorrentAutoSaveCommand::TorrentAutoSaveCommand(int cuid, TorrentDownloadEngine* e, int interval):Command(cuid), e(e), interval(interval) {} TorrentAutoSaveCommand::~TorrentAutoSaveCommand() {} bool TorrentAutoSaveCommand::execute() { if(checkPoint.elapsed(interval) || e->torrentMan->isHalt()) { checkPoint.reset(); e->torrentMan->save(); if(e->torrentMan->isHalt()) { return true; } } e->commands.push_back(this); return false; }