Make a few cosmetic changes in code

This commit is contained in:
thalieht 2020-04-16 20:02:45 +03:00 committed by sledgehammer999
parent 56f7a4e803
commit 73292137b7
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
2 changed files with 6 additions and 7 deletions

View file

@ -882,7 +882,6 @@ Net::ProxyType OptionsDialog::getProxyType() const
switch (m_ui->comboProxyType->currentIndex()) {
case 1:
return Net::ProxyType::SOCKS4;
break;
case 2:
if (isProxyAuthEnabled())
return Net::ProxyType::SOCKS5_PW;
@ -1443,16 +1442,16 @@ void OptionsDialog::toggleComboRatioLimitAct()
m_ui->comboRatioLimitAct->setEnabled(m_ui->checkMaxRatio->isChecked() || m_ui->checkMaxSeedingMinutes->isChecked());
}
void OptionsDialog::enableProxy(int index)
void OptionsDialog::enableProxy(const int index)
{
if (index) {
if (index >= 1) { // Any proxy type is used
//enable
m_ui->lblProxyIP->setEnabled(true);
m_ui->textProxyIP->setEnabled(true);
m_ui->lblProxyPort->setEnabled(true);
m_ui->spinProxyPort->setEnabled(true);
m_ui->checkProxyPeerConnecs->setEnabled(true);
if (index > 1) {
if (index >= 2) { // SOCKS5 or HTTP
m_ui->checkProxyAuth->setEnabled(true);
m_ui->isProxyOnlyForTorrents->setEnabled(true);
}
@ -1463,8 +1462,8 @@ void OptionsDialog::enableProxy(int index)
m_ui->isProxyOnlyForTorrents->setChecked(true);
}
}
else {
//disable
else { // No proxy
// disable
m_ui->lblProxyIP->setEnabled(false);
m_ui->textProxyIP->setEnabled(false);
m_ui->lblProxyPort->setEnabled(false);

View file

@ -82,7 +82,7 @@ class OptionsDialog final : public QDialog
public:
// Constructor / Destructor
OptionsDialog(QWidget *parent = nullptr);
~OptionsDialog();
~OptionsDialog() override;
public slots:
void showConnectionTab();