mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Improved start_All and resume_All functions to detect if a torrent's state changed or not. This way, it doesn't flood the GUI if the user keeps on clicking on those buttons
This commit is contained in:
parent
9bde00b7de
commit
d12e510fad
3 changed files with 42 additions and 34 deletions
|
@ -612,25 +612,31 @@ void bittorrent::saveTrackerFile(const QString& hash){
|
|||
}
|
||||
|
||||
// Pause all torrents in session
|
||||
void bittorrent::pauseAllTorrents(){
|
||||
bool bittorrent::pauseAllTorrents(){
|
||||
bool paused_torrents = false;
|
||||
std::vector<torrent_handle> handles = s->get_torrents();
|
||||
for(unsigned int i=0; i<handles.size(); ++i){
|
||||
torrent_handle h = handles[i];
|
||||
if(h.is_valid() && !h.is_paused()){
|
||||
h.pause();
|
||||
paused_torrents = true;
|
||||
}
|
||||
}
|
||||
return paused_torrents;
|
||||
}
|
||||
|
||||
// Resume all torrents in session
|
||||
void bittorrent::resumeAllTorrents(){
|
||||
bool bittorrent::resumeAllTorrents(){
|
||||
bool resumed_torrents = false;
|
||||
std::vector<torrent_handle> handles = s->get_torrents();
|
||||
for(unsigned int i=0; i<handles.size(); ++i){
|
||||
torrent_handle h = handles[i];
|
||||
if(h.is_valid() && h.is_paused()){
|
||||
h.resume();
|
||||
resumed_torrents = true;
|
||||
}
|
||||
}
|
||||
return resumed_torrents;
|
||||
}
|
||||
|
||||
// Add uT PeX extension to bittorrent session
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue