mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
- Oups, sorry I forgot pause_all() & start_all() functions in last commit :)
- Updated version to v0.9.0beta4
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user