|
|
@ -178,7 +178,7 @@ void FinishedTorrents::updateFinishedList(){ |
|
|
|
if(h.state() == torrent_status::downloading || (h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking && h.progress() < 1.)) { |
|
|
|
if(h.state() == torrent_status::downloading || (h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking && h.progress() < 1.)) { |
|
|
|
// What are you doing here? go back to download tab!
|
|
|
|
// What are you doing here? go back to download tab!
|
|
|
|
qDebug("Info: a torrent was moved from finished to download tab"); |
|
|
|
qDebug("Info: a torrent was moved from finished to download tab"); |
|
|
|
deleteFromFinishedList(hash); |
|
|
|
deleteFromFinishedList(hash, true); |
|
|
|
BTSession->setFinishedTorrent(hash); |
|
|
|
BTSession->setFinishedTorrent(hash); |
|
|
|
emit torrentMovedFromFinishedList(h); |
|
|
|
emit torrentMovedFromFinishedList(h); |
|
|
|
continue; |
|
|
|
continue; |
|
|
@ -200,13 +200,14 @@ int FinishedTorrents::getRowFromHash(QString hash) const{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Will move it to download tab
|
|
|
|
// Will move it to download tab
|
|
|
|
void FinishedTorrents::deleteFromFinishedList(QString hash){ |
|
|
|
void FinishedTorrents::deleteFromFinishedList(QString hash, bool switchTab){ |
|
|
|
int row = getRowFromHash(hash); |
|
|
|
int row = getRowFromHash(hash); |
|
|
|
Q_ASSERT(row != -1); |
|
|
|
Q_ASSERT(row != -1); |
|
|
|
finishedListModel->removeRow(row); |
|
|
|
finishedListModel->removeRow(row); |
|
|
|
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished"); |
|
|
|
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished"); |
|
|
|
--nbFinished; |
|
|
|
--nbFinished; |
|
|
|
((GUI*)parent)->setTabText(1, tr("Finished") +" ("+QString::fromUtf8(misc::toString(nbFinished).c_str())+")"); |
|
|
|
((GUI*)parent)->setTabText(1, tr("Finished") +" ("+QString::fromUtf8(misc::toString(nbFinished).c_str())+")"); |
|
|
|
|
|
|
|
if(switchTab) |
|
|
|
BTSession->setUnfinishedTorrent(hash); |
|
|
|
BTSession->setUnfinishedTorrent(hash); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|