Don't use deprecated libtorrent features

This commit is contained in:
Vladimir Golovnev (Glassez)
2019-07-18 19:53:04 +03:00
parent 7f3291c3de
commit 60ffa3030e
16 changed files with 130 additions and 186 deletions

View File

@@ -96,7 +96,6 @@ enum AdvSettingsRows
DISK_CACHE,
DISK_CACHE_TTL,
OS_CACHE,
GUIDED_READ_CACHE,
COALESCE_RW,
SUGGEST_MODE,
SEND_BUF_WATERMARK,
@@ -166,8 +165,6 @@ void AdvancedSettings::saveAdvancedSettings()
session->setDiskCacheTTL(spinBoxCacheTTL.value());
// Enable OS cache
session->setUseOSCache(checkBoxOsCache.isChecked());
// Guided read cache
session->setGuidedReadCacheEnabled(checkBoxGuidedReadCache.isChecked());
// Coalesce reads & writes
session->setCoalesceReadWriteEnabled(checkBoxCoalesceRW.isChecked());
// Suggest mode
@@ -382,10 +379,6 @@ void AdvancedSettings::loadAdvancedSettings()
checkBoxOsCache.setChecked(session->useOSCache());
addRow(OS_CACHE, (tr("Enable OS cache") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#disk_io_write_mode", "(?)"))
, &checkBoxOsCache);
// Guided read cache
checkBoxGuidedReadCache.setChecked(session->isGuidedReadCacheEnabled());
addRow(GUIDED_READ_CACHE, (tr("Guided read cache") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#guided_read_cache", "(?)"))
, &checkBoxGuidedReadCache);
// Coalesce reads & writes
checkBoxCoalesceRW.setChecked(session->isCoalesceReadWriteEnabled());
addRow(COALESCE_RW, (tr("Coalesce reads & writes") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#coalesce_reads", "(?)"))

View File

@@ -64,7 +64,7 @@ private:
QCheckBox checkBoxOsCache, checkBoxRecheckCompleted, checkBoxResolveCountries, checkBoxResolveHosts, checkBoxSuperSeeding,
checkBoxProgramNotifications, checkBoxTorrentAddedNotifications, checkBoxTrackerFavicon, checkBoxTrackerStatus,
checkBoxConfirmTorrentRecheck, checkBoxConfirmRemoveAllTags, checkBoxListenIPv6, checkBoxAnnounceAllTrackers, checkBoxAnnounceAllTiers,
checkBoxGuidedReadCache, checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW, checkBoxSpeedWidgetEnabled;
checkBoxMultiConnectionsPerIp, checkBoxSuggestMode, checkBoxCoalesceRW, checkBoxSpeedWidgetEnabled;
QComboBox comboBoxInterface, comboBoxInterfaceAddress, comboBoxUtpMixedMode, comboBoxChokingAlgorithm, comboBoxSeedChokingAlgorithm;
QLineEdit lineEditAnnounceIP;

View File

@@ -211,7 +211,6 @@ OptionsDialog::OptionsDialog(QWidget *parent)
void (QComboBox::*qComboBoxCurrentIndexChanged)(int) = &QComboBox::currentIndexChanged;
void (QSpinBox::*qSpinBoxValueChanged)(int) = &QSpinBox::valueChanged;
connect(m_ui->checkForceProxy, &QAbstractButton::toggled, this, &ThisType::enableForceProxy);
connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableProxy);
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, m_ui->spinPort, &ThisType::setDisabled);
@@ -353,7 +352,6 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinProxyPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkProxyPeerConnecs, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkForceProxy, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->isProxyOnlyForTorrents, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProxyAuth, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->textProxyUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
@@ -728,7 +726,6 @@ void OptionsDialog::saveOptions()
proxyConfigManager->setProxyConfiguration(proxyConf);
session->setProxyPeerConnectionsEnabled(m_ui->checkProxyPeerConnecs->isChecked());
session->setForceProxyEnabled(m_ui->checkForceProxy->isChecked());
// End Connection preferences
// Bittorrent preferences
@@ -1057,8 +1054,6 @@ void OptionsDialog::loadOptions()
m_ui->textProxyPassword->setText(proxyConf.password);
m_ui->checkProxyPeerConnecs->setChecked(session->isProxyPeerConnectionsEnabled());
m_ui->checkForceProxy->setChecked(session->isForceProxyEnabled());
enableForceProxy(session->isForceProxyEnabled());
m_ui->isProxyOnlyForTorrents->setChecked(proxyConfigManager->isProxyOnlyForTorrents());
enableProxy(m_ui->comboProxyType->currentIndex());
@@ -1358,12 +1353,6 @@ void OptionsDialog::toggleComboRatioLimitAct()
m_ui->comboRatioLimitAct->setEnabled(m_ui->checkMaxRatio->isChecked() || m_ui->checkMaxSeedingMinutes->isChecked());
}
void OptionsDialog::enableForceProxy(bool enable)
{
m_ui->checkUPnP->setEnabled(!enable);
m_ui->checkLSD->setEnabled(!enable);
}
void OptionsDialog::enableProxy(int index)
{
if (index) {
@@ -1373,7 +1362,6 @@ void OptionsDialog::enableProxy(int index)
m_ui->lblProxyPort->setEnabled(true);
m_ui->spinProxyPort->setEnabled(true);
m_ui->checkProxyPeerConnecs->setEnabled(true);
m_ui->checkForceProxy->setEnabled(true);
if (index > 1) {
m_ui->checkProxyAuth->setEnabled(true);
m_ui->isProxyOnlyForTorrents->setEnabled(true);
@@ -1384,7 +1372,6 @@ void OptionsDialog::enableProxy(int index)
m_ui->isProxyOnlyForTorrents->setEnabled(false);
m_ui->isProxyOnlyForTorrents->setChecked(true);
}
enableForceProxy(m_ui->checkForceProxy->isChecked());
}
else {
//disable
@@ -1393,11 +1380,9 @@ void OptionsDialog::enableProxy(int index)
m_ui->lblProxyPort->setEnabled(false);
m_ui->spinProxyPort->setEnabled(false);
m_ui->checkProxyPeerConnecs->setEnabled(false);
m_ui->checkForceProxy->setEnabled(false);
m_ui->isProxyOnlyForTorrents->setEnabled(false);
m_ui->checkProxyAuth->setEnabled(false);
m_ui->checkProxyAuth->setChecked(false);
enableForceProxy(false);
}
}

View File

@@ -87,7 +87,6 @@ public slots:
void showConnectionTab();
private slots:
void enableForceProxy(bool enable);
void enableProxy(int index);
void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e) override;

View File

@@ -1633,43 +1633,6 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="forceProxyHorizontalLayout">
<item>
<widget class="QCheckBox" name="checkForceProxy">
<property name="text">
<string>Disable connections not supported by proxies</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelForceProxy">
<property name="text">
<string>(&lt;a href=&quot;https://github.com/qbittorrent/qBittorrent/wiki/Disable-connections-not-supported-by-proxies&quot;&gt;More information&lt;/a&gt;)</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_22">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="isProxyOnlyForTorrents">
<property name="toolTip">
@@ -3342,7 +3305,6 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>textProxyIP</tabstop>
<tabstop>spinProxyPort</tabstop>
<tabstop>checkProxyPeerConnecs</tabstop>
<tabstop>checkForceProxy</tabstop>
<tabstop>isProxyOnlyForTorrents</tabstop>
<tabstop>checkProxyAuth</tabstop>
<tabstop>textProxyUsername</tabstop>