mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Oups, sorry I forgot pause_all() & start_all() functions in last commit :)
- Updated version to v0.9.0beta4
This commit is contained in:
parent
bd3bde919d
commit
aa6f6161c3
5 changed files with 71 additions and 5 deletions
|
@ -497,6 +497,28 @@ void bittorrent::setGlobalRatio(float ratio){
|
|||
}
|
||||
}
|
||||
|
||||
// Pause all torrents in session
|
||||
void bittorrent::pauseAllTorrents(){
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Resume all torrents in session
|
||||
void bittorrent::resumeAllTorrents(){
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add uT PeX extension to bittorrent session
|
||||
void bittorrent::enablePeerExchange(){
|
||||
s->add_extension(&create_ut_pex_plugin);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue