mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Still simplifying program options
This commit is contained in:
parent
335e7366fd
commit
da599da36d
6 changed files with 8 additions and 114 deletions
|
@ -521,8 +521,6 @@ void Bittorrent::configureSession() {
|
|||
addConsoleMessage(tr("Encryption support [OFF]"), QString::fromUtf8("blue"));
|
||||
}
|
||||
applyEncryptionSettings(encryptionSettings);
|
||||
// * Desired ratio
|
||||
setGlobalRatio(Preferences::getDesiredRatio());
|
||||
// * Maximum ratio
|
||||
setDeleteRatio(Preferences::getDeleteRatio());
|
||||
// Ip Filter
|
||||
|
@ -1763,26 +1761,6 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||
s->set_upload_rate_limit(rate);
|
||||
}
|
||||
|
||||
// libtorrent allow to adjust ratio for each torrent
|
||||
// This function will apply to same ratio to all torrents
|
||||
void Bittorrent::setGlobalRatio(float ratio) {
|
||||
if(ratio != -1 && ratio < 1.) ratio = 1.;
|
||||
if(ratio == -1) {
|
||||
// 0 means unlimited for libtorrent
|
||||
ratio = 0;
|
||||
}
|
||||
std::vector<torrent_handle> handles = s->get_torrents();
|
||||
std::vector<torrent_handle>::iterator it;
|
||||
for(it = handles.begin(); it != handles.end(); it++) {
|
||||
QTorrentHandle h(*it);
|
||||
if(!h.is_valid()) {
|
||||
qDebug("/!\\ Error: Invalid handle");
|
||||
continue;
|
||||
}
|
||||
h.set_ratio(ratio);
|
||||
}
|
||||
}
|
||||
|
||||
// Torrents will a ratio superior to the given value will
|
||||
// be automatically deleted
|
||||
void Bittorrent::setDeleteRatio(float ratio) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue