1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Save ignored ssl hosts on yes (SSLErrorDialog) and NetworkManager::shutdown()

This commit is contained in:
Javier Llorente 2023-04-24 23:00:06 +02:00 committed by Juraj Oravec
parent 34e7eb1713
commit 70b8544f9b
2 changed files with 8 additions and 1 deletions

View File

@ -96,6 +96,7 @@ bool NetworkManager::certificateError(const QWebEngineCertificateError &error, Q
switch (dialog.result()) {
case SslErrorDialog::Yes:
m_ignoredSslHosts.append(host);
saveIgnoredSslHosts();
return true;
case SslErrorDialog::OnlyForThisSession:
@ -298,14 +299,18 @@ void NetworkManager::loadSettings()
settings.endGroup();
}
void NetworkManager::shutdown()
void NetworkManager::saveIgnoredSslHosts()
{
Settings settings;
settings.beginGroup("Web-Browser-Settings");
settings.setValue("IgnoredSslHosts", m_ignoredSslHosts);
settings.endGroup();
}
void NetworkManager::shutdown()
{
mApp->webProfile()->setUrlRequestInterceptor(nullptr);
saveIgnoredSslHosts();
}
// static

View File

@ -54,6 +54,8 @@ protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) override;
private:
void saveIgnoredSslHosts();
NetworkUrlInterceptor *m_urlInterceptor;
ExtensionSchemeManager *m_extensionScheme;
QHash<QString, QWebEngineCertificateError::Error> m_ignoredSslErrors;