mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
- Code optimization for torrent moving back to download list detection
This commit is contained in:
parent
8ed40cc856
commit
61dae1444b
1 changed files with 7 additions and 7 deletions
14
src/GUI.cpp
14
src/GUI.cpp
|
@ -376,6 +376,13 @@ void GUI::checkedTorrent(QTorrentHandle& h) const {
|
|||
// Move torrent to finished tab
|
||||
downloadingTorrentTab->deleteTorrent(h.hash());
|
||||
finishedTorrentTab->addTorrent(h.hash());
|
||||
} else {
|
||||
// Move torrent back to download list (if necessary)
|
||||
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+h.hash()+".finished")) {
|
||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+h.hash()+".finished");
|
||||
finishedTorrentTab->deleteTorrent(h.hash());
|
||||
downloadingTorrentTab->addTorrent(h.hash());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1358,13 +1365,6 @@ void GUI::updateLists(bool force) {
|
|||
// Update in finished list
|
||||
finishedTorrentTab->updateTorrent(h);
|
||||
} else {
|
||||
// Delete from finished list, if it moved back
|
||||
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+h.hash()+".finished")) {
|
||||
if(h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking) {
|
||||
finishedTorrentTab->deleteTorrent(h.hash());
|
||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+h.hash()+".finished");
|
||||
}
|
||||
}
|
||||
// Update in download list
|
||||
downloadingTorrentTab->updateTorrent(h);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue