style: fix minor coding style issues

This commit is contained in:
Oleg Shparber 2023-08-06 14:14:05 -04:00
parent 9eb6169073
commit ac992e5aa0
6 changed files with 9 additions and 12 deletions

View File

@ -66,10 +66,9 @@ Application::Application(QObject *parent)
m_fileManager = new FileManager(this);
m_httpServer = new HttpServer(this);
connect(m_networkManager, &QNetworkAccessManager::sslErrors, this, [this](QNetworkReply *reply, const QList<QSslError> &errors)
{
if (m_settings->isIgnoreSSLErrorsEnabled) {
// Ignore all SSL errors
connect(m_networkManager, &QNetworkAccessManager::sslErrors,
this, [this](QNetworkReply *reply, const QList<QSslError> &errors) {
if (m_settings->isIgnoreSslErrorsEnabled) {
reply->ignoreSslErrors();
}
});
@ -285,7 +284,6 @@ void Application::applySettings()
// Force NM to pick up changes.
m_networkManager->clearAccessCache();
}
QString Application::userAgent()

View File

@ -181,7 +181,7 @@ void Settings::load()
proxyAuthenticate = settings->value(QStringLiteral("authenticate"), false).toBool();
proxyUserName = settings->value(QStringLiteral("username")).toString();
proxyPassword = settings->value(QStringLiteral("password")).toString();
isIgnoreSSLErrorsEnabled = settings->value(QStringLiteral("ignore_ssl_errors"), false).toBool();
isIgnoreSslErrorsEnabled = settings->value(QStringLiteral("ignore_ssl_errors"), false).toBool();
settings->endGroup();
settings->beginGroup(GroupDocsets);
@ -269,7 +269,7 @@ void Settings::save()
settings->setValue(QStringLiteral("authenticate"), proxyAuthenticate);
settings->setValue(QStringLiteral("username"), proxyUserName);
settings->setValue(QStringLiteral("password"), proxyPassword);
settings->setValue(QStringLiteral("ignore_ssl_errors"), isIgnoreSSLErrorsEnabled);
settings->setValue(QStringLiteral("ignore_ssl_errors"), isIgnoreSslErrorsEnabled);
settings->endGroup();
settings->beginGroup(GroupDocsets);

View File

@ -99,7 +99,6 @@ public:
Socks5 = 4
};
Q_ENUM(ProxyType)
bool isIgnoreSSLErrorsEnabled;
// Internal
// --------
@ -114,6 +113,7 @@ public:
bool proxyAuthenticate;
QString proxyUserName;
QString proxyPassword;
bool isIgnoreSslErrorsEnabled;
// Other
QString docsetPath;

View File

@ -675,7 +675,6 @@ bool DocsetsDialog::updatesAvailable() const
QNetworkReply *DocsetsDialog::download(const QUrl &url)
{
QNetworkReply *reply = m_application->download(url);
connect(reply, &QNetworkReply::downloadProgress, this, &DocsetsDialog::downloadProgress);
connect(reply, &QNetworkReply::finished, this, &DocsetsDialog::downloadCompleted);
m_replies.append(reply);

View File

@ -256,7 +256,7 @@ void SettingsDialog::loadSettings()
ui->proxyUsernameEdit->setText(settings->proxyUserName);
ui->proxyPasswordEdit->setText(settings->proxyPassword);
ui->ignoreSSLErrorsCheckBox->setChecked(settings->isIgnoreSSLErrorsEnabled);
ui->ignoreSslErrorsCheckBox->setChecked(settings->isIgnoreSslErrorsEnabled);
}
void SettingsDialog::saveSettings()
@ -332,7 +332,7 @@ void SettingsDialog::saveSettings()
settings->proxyUserName = ui->proxyUsernameEdit->text();
settings->proxyPassword = ui->proxyPasswordEdit->text();
settings->isIgnoreSSLErrorsEnabled = ui->ignoreSSLErrorsCheckBox->isChecked();
settings->isIgnoreSslErrorsEnabled = ui->ignoreSslErrorsCheckBox->isChecked();
settings->save();
}

View File

@ -752,7 +752,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<widget class="QCheckBox" name="ignoreSSLErrorsCheckBox">
<widget class="QCheckBox" name="ignoreSslErrorsCheckBox">
<property name="text">
<string>Ignore SSL errors</string>
</property>