Drop I2P support with libtorrent 1.2

PR #19207.
Closes #19152.
This commit is contained in:
Vladimir Golovnev 2023-06-23 16:24:34 +03:00 committed by GitHub
parent 379b0dbe40
commit 3b948b0130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 7 deletions

View file

@ -791,10 +791,14 @@ void OptionsDialog::loadConnectionTabOptions()
m_ui->spinMaxUploadsPerTorrent->setEnabled(false);
}
#if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
m_ui->textI2PHost->setText(session->I2PAddress());
m_ui->spinI2PPort->setValue(session->I2PPort());
m_ui->checkI2PMixed->setChecked(session->I2PMixedMode());
m_ui->groupI2P->setChecked(session->isI2PEnabled());
#else
m_ui->groupI2P->hide();
#endif
const auto *proxyConfigManager = Net::ProxyConfigurationManager::instance();
const Net::ProxyConfiguration proxyConf = proxyConfigManager->proxyConfiguration();
@ -845,10 +849,12 @@ void OptionsDialog::loadConnectionTabOptions()
connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinProxyPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
#if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
connect(m_ui->textI2PHost, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinI2PPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkI2PMixed, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->groupI2P, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
#endif
connect(m_ui->checkProxyBitTorrent, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProxyBitTorrent, &QGroupBox::toggled, this, &ThisType::adjustProxyOptions);
@ -881,10 +887,12 @@ void OptionsDialog::saveConnectionTabOptions() const
session->setMaxUploads(getMaxUploads());
session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent());
#if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
session->setI2PEnabled(m_ui->groupI2P->isChecked());
session->setI2PAddress(m_ui->textI2PHost->text().trimmed());
session->setI2PPort(m_ui->spinI2PPort->value());
session->setI2PMixedMode(m_ui->checkI2PMixed->isChecked());
#endif
auto *proxyConfigManager = Net::ProxyConfigurationManager::instance();
Net::ProxyConfiguration proxyConf;