Browse Source

Prevent possible problem of using incomplete type

PR #18639.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
37c04fdeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      src/base/net/downloadmanager.cpp
  2. 3
      src/base/net/downloadmanager.h

23
src/base/net/downloadmanager.cpp

@ -122,7 +122,17 @@ Net::DownloadManager::DownloadManager(QObject *parent)
, m_networkManager {new QNetworkAccessManager(this)} , m_networkManager {new QNetworkAccessManager(this)}
{ {
m_networkManager->setCookieJar(m_networkCookieJar); m_networkManager->setCookieJar(m_networkCookieJar);
connect(m_networkManager, &QNetworkAccessManager::sslErrors, this, &Net::DownloadManager::ignoreSslErrors); connect(m_networkManager, &QNetworkAccessManager::sslErrors, this
, [](QNetworkReply *reply, const QList<QSslError> &errors)
{
QStringList errorList;
for (const QSslError &error : errors)
errorList += error.errorString();
LogMsg(tr("Ignoring SSL error, URL: \"%1\", errors: \"%2\"").arg(reply->url().toString(), errorList.join(u". ")), Log::WARNING);
// Ignore all SSL errors
reply->ignoreSslErrors();
});
connect(ProxyConfigurationManager::instance(), &ProxyConfigurationManager::proxyConfigurationChanged connect(ProxyConfigurationManager::instance(), &ProxyConfigurationManager::proxyConfigurationChanged
, this, &DownloadManager::applyProxySettings); , this, &DownloadManager::applyProxySettings);
@ -304,17 +314,6 @@ void Net::DownloadManager::processRequest(DownloadHandlerImpl *downloadHandler)
downloadHandler->assignNetworkReply(m_networkManager->get(request)); downloadHandler->assignNetworkReply(m_networkManager->get(request));
} }
void Net::DownloadManager::ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
{
QStringList errorList;
for (const QSslError &error : errors)
errorList += error.errorString();
LogMsg(tr("Ignoring SSL error, URL: \"%1\", errors: \"%2\"").arg(reply->url().toString(), errorList.join(u". ")), Log::WARNING);
// Ignore all SSL errors
reply->ignoreSslErrors();
}
Net::DownloadRequest::DownloadRequest(const QString &url) Net::DownloadRequest::DownloadRequest(const QString &url)
: m_url {url} : m_url {url}
{ {

3
src/base/net/downloadmanager.h

@ -151,9 +151,6 @@ namespace Net
static bool hasSupportedScheme(const QString &url); static bool hasSupportedScheme(const QString &url);
private slots:
void ignoreSslErrors(QNetworkReply *, const QList<QSslError> &);
private: private:
class NetworkCookieJar; class NetworkCookieJar;

Loading…
Cancel
Save