mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 17:56:50 +03:00
- Fixed torrent switching to finished tab
This commit is contained in:
parent
366d5108c4
commit
4e2ebe5a69
3 changed files with 9 additions and 7 deletions
|
@ -262,7 +262,10 @@ QString FinishedTorrents::getHashFromRow(unsigned int row) const {
|
|||
// Will move it to download tab
|
||||
void FinishedTorrents::deleteTorrent(QString hash){
|
||||
int row = getRowFromHash(hash);
|
||||
Q_ASSERT(row != -1);
|
||||
if(row == -1){
|
||||
qDebug("Torrent is not in finished list, nothing to delete");
|
||||
return;
|
||||
}
|
||||
finishedListModel->removeRow(row);
|
||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
||||
--nbFinished;
|
||||
|
|
|
@ -251,11 +251,7 @@ void GUI::finishedTorrent(QTorrentHandle& h) {
|
|||
}
|
||||
if(show_msg)
|
||||
downloadingTorrentTab->setInfoBar(tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName));
|
||||
if(BTSession->getUnfinishedTorrents().contains(hash)) {
|
||||
downloadingTorrentTab->deleteTorrent(hash);
|
||||
}else{
|
||||
qDebug("finished torrent %s is not in download list, nothing to do", hash.toUtf8().data());
|
||||
}
|
||||
finishedTorrentTab->addTorrent(hash);
|
||||
if(show_msg && systrayIntegration && (useOSD == 1 || (useOSD == 2 && (isMinimized() || isHidden())))) {
|
||||
myTrayIcon->showMessage(tr("Download finished"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
||||
|
|
|
@ -176,7 +176,10 @@ void DownloadingTorrents::resumeTorrent(QString hash){
|
|||
// Remove a torrent from the download list but NOT from the BT Session
|
||||
void DownloadingTorrents::deleteTorrent(QString hash) {
|
||||
int row = getRowFromHash(hash);
|
||||
Q_ASSERT(row != -1);
|
||||
if(row == -1){
|
||||
qDebug("torrent is not in download list, nothing to delete");
|
||||
return;
|
||||
}
|
||||
DLListModel->removeRow(row);
|
||||
--nbTorrents;
|
||||
emit unfinishedTorrentsNumberChanged(nbTorrents);
|
||||
|
|
Loading…
Reference in a new issue