Browse Source

Code clean up

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
e5eaea8949
  1. 8
      src/qtlibtorrent/qbtsession.cpp

8
src/qtlibtorrent/qbtsession.cpp

@ -70,7 +70,7 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>
#if LIBTORRENT_VERSION_MINOR > 15 #if LIBTORRENT_VERSION_MINOR > 15
#include "libtorrent/error_code.hpp" #include "libtorrent/error_code.hpp"
#endif #endif
#include <queue> #include <queue>
@ -393,8 +393,6 @@ void QBtSession::configureSession() {
sessionSettings.announce_to_all_tiers = true; //uTorrent behavior sessionSettings.announce_to_all_tiers = true; //uTorrent behavior
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
#endif #endif
// To keep same behavior as in qBittorrent v1.2.0
sessionSettings.rate_limit_ip_overhead = false;
sessionSettings.cache_size = pref.diskCacheSize()*64; sessionSettings.cache_size = pref.diskCacheSize()*64;
addConsoleMessage(tr("Using a disk cache size of %1 MiB").arg(pref.diskCacheSize())); addConsoleMessage(tr("Using a disk cache size of %1 MiB").arg(pref.diskCacheSize()));
// Queueing System // Queueing System
@ -412,12 +410,12 @@ void QBtSession::configureSession() {
} }
// Outgoing ports // Outgoing ports
sessionSettings.outgoing_ports = std::make_pair(pref.outgoingPortsMin(), pref.outgoingPortsMax()); sessionSettings.outgoing_ports = std::make_pair(pref.outgoingPortsMin(), pref.outgoingPortsMax());
setSessionSettings(sessionSettings);
// Ignore limits on LAN // Ignore limits on LAN
qDebug() << "Ignore limits on LAN" << pref.ignoreLimitsOnLAN(); qDebug() << "Ignore limits on LAN" << pref.ignoreLimitsOnLAN();
sessionSettings.ignore_limits_on_local_network = pref.ignoreLimitsOnLAN(); sessionSettings.ignore_limits_on_local_network = pref.ignoreLimitsOnLAN();
// Include overhead in transfer limits // Include overhead in transfer limits
sessionSettings.rate_limit_ip_overhead = pref.includeOverheadInLimits(); sessionSettings.rate_limit_ip_overhead = pref.includeOverheadInLimits();
setSessionSettings(sessionSettings);
// Bittorrent // Bittorrent
// * Max Half-open connections // * Max Half-open connections
s->set_max_half_open_connections(pref.getMaxHalfOpenConnections()); s->set_max_half_open_connections(pref.getMaxHalfOpenConnections());
@ -1438,7 +1436,9 @@ bool QBtSession::enableDHT(bool b) {
} }
#endif #endif
try { try {
qDebug() << "Starting DHT...";
#if LIBTORRENT_VERSION_MINOR > 14 #if LIBTORRENT_VERSION_MINOR > 14
Q_ASSERT(!s->is_dht_running());
s->start_dht(); s->start_dht();
#else #else
s->start_dht(dht_state); s->start_dht(dht_state);

Loading…
Cancel
Save