mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Drop libtorrent 0.15.x support.
This commit is contained in:
@@ -13,11 +13,7 @@
|
||||
#include "preferences.h"
|
||||
|
||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
||||
enum AdvSettingsRows {DISK_CACHE,
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
DISK_CACHE_TTL,
|
||||
#endif
|
||||
OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
|
||||
enum AdvSettingsRows {DISK_CACHE, DISK_CACHE_TTL, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
|
||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||
UPDATE_CHECK,
|
||||
#endif
|
||||
@@ -37,9 +33,7 @@ private:
|
||||
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
|
||||
cb_enable_tracker_ext;
|
||||
QComboBox combo_iface;
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
QSpinBox spin_cache_ttl;
|
||||
#endif
|
||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||
QCheckBox cb_update_check;
|
||||
#endif
|
||||
@@ -76,9 +70,7 @@ public slots:
|
||||
Preferences pref;
|
||||
// Disk write cache
|
||||
pref.setDiskCacheSize(spin_cache.value());
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
pref.setDiskCacheTTL(spin_cache_ttl.value());
|
||||
#endif
|
||||
// Outgoing ports
|
||||
pref.setOutgoingPortsMin(outgoing_ports_min.value());
|
||||
pref.setOutgoingPortsMax(outgoing_ports_max.value());
|
||||
@@ -182,14 +174,12 @@ private slots:
|
||||
spin_cache.setValue(pref.diskCacheSize());
|
||||
updateCacheSpinSuffix(spin_cache.value());
|
||||
setRow(DISK_CACHE, tr("Disk write cache size"), &spin_cache);
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
// Disk cache expiry
|
||||
spin_cache_ttl.setMinimum(15);
|
||||
spin_cache_ttl.setMaximum(600);
|
||||
spin_cache_ttl.setValue(pref.diskCacheTTL());
|
||||
spin_cache_ttl.setSuffix(tr(" s", " seconds"));
|
||||
setRow(DISK_CACHE_TTL, tr("Disk cache expiry interval"), &spin_cache_ttl);
|
||||
#endif
|
||||
// Outgoing port Min
|
||||
outgoing_ports_min.setMinimum(0);
|
||||
outgoing_ports_min.setMaximum(65535);
|
||||
|
||||
@@ -122,10 +122,6 @@ options_imp::options_imp(QWidget *parent):
|
||||
checkStartup->setVisible(false);
|
||||
groupFileAssociation->setVisible(false);
|
||||
#endif
|
||||
#if LIBTORRENT_VERSION_NUM < 001600
|
||||
checkAnonymousMode->setVisible(false);
|
||||
label_anonymous->setVisible(false);
|
||||
#endif
|
||||
|
||||
// Connect signals / slots
|
||||
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int)));
|
||||
@@ -208,9 +204,7 @@ options_imp::options_imp(QWidget *parent):
|
||||
connect(spinMaxUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||
connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||
connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
#endif
|
||||
connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||
connect(spinDHTPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||
@@ -254,10 +248,6 @@ options_imp::options_imp(QWidget *parent):
|
||||
applyButton->setEnabled(false);
|
||||
// Tab selection mecanism
|
||||
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
|
||||
#if LIBTORRENT_VERSION_NUM < 001600
|
||||
checkuTP->setVisible(false);
|
||||
checkLimituTPConnections->setVisible(false);
|
||||
#endif
|
||||
// Load Advanced settings
|
||||
QVBoxLayout *adv_layout = new QVBoxLayout();
|
||||
advancedSettings = new AdvancedSettings();
|
||||
@@ -459,9 +449,7 @@ void options_imp::saveOptions() {
|
||||
pref.setDHTPort(getDHTPort());
|
||||
pref.setLSDEnabled(isLSDEnabled());
|
||||
pref.setEncryptionSetting(getEncryptionSetting());
|
||||
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||
pref.enableAnonymousMode(checkAnonymousMode->isChecked());
|
||||
#endif
|
||||
pref.setGlobalMaxRatio(getMaxRatio());
|
||||
pref.setMaxRatioAction(comboRatioLimitAct->currentIndex());
|
||||
// End Bittorrent preferences
|
||||
@@ -745,11 +733,9 @@ void options_imp::loadOptions() {
|
||||
checkPeX->setChecked(pref.isPeXEnabled());
|
||||
checkLSD->setChecked(pref.isLSDEnabled());
|
||||
comboEncryption->setCurrentIndex(pref.getEncryptionSetting());
|
||||
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||
checkAnonymousMode->setChecked(pref.isAnonymousModeEnabled());
|
||||
/* make sure ui matches options */
|
||||
toggleAnonymousMode(checkAnonymousMode->isChecked());
|
||||
#endif
|
||||
// Ratio limit
|
||||
floatValue = pref.getGlobalMaxRatio();
|
||||
if (floatValue >= 0.) {
|
||||
|
||||
@@ -976,18 +976,13 @@ public:
|
||||
}
|
||||
|
||||
uint diskCacheSize() const {
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 0).toUInt();
|
||||
#else
|
||||
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 128).toUInt();
|
||||
#endif
|
||||
}
|
||||
|
||||
void setDiskCacheSize(uint size) {
|
||||
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), size);
|
||||
}
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM >= 001610
|
||||
uint diskCacheTTL() const {
|
||||
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheTTL"), 60).toUInt();
|
||||
}
|
||||
@@ -995,7 +990,6 @@ public:
|
||||
void setDiskCacheTTL(uint ttl) {
|
||||
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheTTL"), ttl);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint outgoingPortsMin() const {
|
||||
return value(QString::fromUtf8("Preferences/Advanced/OutgoingPortsMin"), 0).toUInt();
|
||||
@@ -1105,7 +1099,6 @@ public:
|
||||
return value(QString::fromUtf8("Preferences/Connection/InetAddress"), QString()).toString();
|
||||
}
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||
bool isAnonymousModeEnabled() const {
|
||||
return value(QString::fromUtf8("Preferences/Advanced/AnonymousMode"), false).toBool();
|
||||
}
|
||||
@@ -1113,7 +1106,6 @@ public:
|
||||
void enableAnonymousMode(bool enabled) {
|
||||
setValue(QString::fromUtf8("Preferences/Advanced/AnonymousMode"), enabled);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool isSuperSeedingEnabled() const {
|
||||
return value(QString::fromUtf8("Preferences/Advanced/SuperSeeding"), false).toBool();
|
||||
|
||||
Reference in New Issue
Block a user