/* */ #include "TorrentAutoSaveCommand.h" #include "SleepCommand.h" TorrentAutoSaveCommand::TorrentAutoSaveCommand(int cuid, TorrentDownloadEngine* e, int interval):Command(cuid), e(e), interval(interval) {} TorrentAutoSaveCommand::~TorrentAutoSaveCommand() {} bool TorrentAutoSaveCommand::execute() { if(e->torrentMan->downloadComplete()) { return true; } e->torrentMan->save(); SleepCommand* sleepCommand = new SleepCommand(cuid, e, this, interval); e->commands.push_back(sleepCommand); return false; }