mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Code clean up
This commit is contained in:
parent
1d795d85d2
commit
5cd376d2c3
3 changed files with 14 additions and 37 deletions
|
@ -802,12 +802,13 @@ void QBtSession::pauseAllTorrents() {
|
|||
std::vector<torrent_handle> torrents = s->get_torrents();
|
||||
std::vector<torrent_handle>::iterator torrentIT;
|
||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
if(!h.is_valid()) continue;
|
||||
if(!h.is_paused()) {
|
||||
h.pause();
|
||||
emit pausedTorrent(h);
|
||||
}
|
||||
try {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
if(!h.is_paused()) {
|
||||
h.pause();
|
||||
emit pausedTorrent(h);
|
||||
}
|
||||
} catch(invalid_handle&) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -819,12 +820,13 @@ void QBtSession::resumeAllTorrents() {
|
|||
std::vector<torrent_handle> torrents = s->get_torrents();
|
||||
std::vector<torrent_handle>::iterator torrentIT;
|
||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
if(!h.is_valid()) continue;
|
||||
if(h.is_paused()) {
|
||||
h.resume();
|
||||
emit resumedTorrent(h);
|
||||
}
|
||||
try {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
if(h.is_paused()) {
|
||||
h.resume();
|
||||
emit resumedTorrent(h);
|
||||
}
|
||||
} catch(invalid_handle&) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue