1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 20:44:15 +00:00

Prevent possible problem of using incomplete type

PR #18639.
This commit is contained in:
Vladimir Golovnev 2023-03-02 06:18:51 +03:00 committed by GitHub
parent c51aa2d573
commit 37c04fdeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 15 deletions

View File

@ -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}
{ {

View File

@ -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;