Still simplifying program options

This commit is contained in:
Christophe Dumez 2010-06-21 21:39:29 +00:00
commit da599da36d
6 changed files with 8 additions and 114 deletions

View file

@ -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) {