mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
- Improved finished torrents code a little
This commit is contained in:
parent
2bf0aba48a
commit
a01c7e2c60
1 changed files with 4 additions and 4 deletions
|
@ -1586,15 +1586,15 @@ void GUI::finishedTorrent(torrent_handle& h){
|
||||||
}
|
}
|
||||||
if(show_msg)
|
if(show_msg)
|
||||||
setInfoBar(tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName));
|
setInfoBar(tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName));
|
||||||
QList<QStandardItem *> items = DLListModel->findItems(hash, Qt::MatchExactly, HASH);
|
int row = getRowFromHash(hash);
|
||||||
Q_ASSERT(items.size() <= 1);
|
if(row != -1){
|
||||||
if(items.size() != 0){
|
DLListModel->removeRow(row);
|
||||||
DLListModel->removeRow(DLListModel->indexFromItem(items.at(0)).row());
|
|
||||||
--nbTorrents;
|
--nbTorrents;
|
||||||
tabs->setTabText(0, tr("Downloads") +" ("+QString(misc::toString(nbTorrents).c_str())+")");
|
tabs->setTabText(0, tr("Downloads") +" ("+QString(misc::toString(nbTorrents).c_str())+")");
|
||||||
}else{
|
}else{
|
||||||
qDebug("finished torrent %s is not in download list, nothing to do", (const char*)hash.toUtf8());
|
qDebug("finished torrent %s is not in download list, nothing to do", (const char*)hash.toUtf8());
|
||||||
}
|
}
|
||||||
|
finishedTorrentTab->addFinishedTorrent(hash);
|
||||||
if(show_msg && systrayIntegration && (useOSD == 1 || (useOSD == 2 && (isMinimized() || isHidden())))) {
|
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);
|
myTrayIcon->showMessage(tr("Download finished"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue