mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Bring back support for setting AcceptLanguage header
This commit is contained in:
parent
3d8b09653f
commit
8778ddc2dd
@ -924,6 +924,7 @@ void MainApplication::loadSettings()
|
||||
}
|
||||
|
||||
qzSettings->loadSettings();
|
||||
networkManager()->loadSettings();
|
||||
userAgentManager()->loadSettings();
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,9 @@
|
||||
#include "networkmanager.h"
|
||||
#include "autofill.h"
|
||||
#include "qztools.h"
|
||||
#include "settings.h"
|
||||
#include "cookiejar.h"
|
||||
#include "acceptlanguage.h"
|
||||
#include "mainapplication.h"
|
||||
#include "passwordmanager.h"
|
||||
#include "sslerrordialog.h"
|
||||
@ -226,3 +228,13 @@ void NetworkManager::removeUrlInterceptor(UrlInterceptor *interceptor)
|
||||
{
|
||||
m_urlInterceptor->removeUrlInterceptor(interceptor);
|
||||
}
|
||||
|
||||
void NetworkManager::loadSettings()
|
||||
{
|
||||
Settings settings;
|
||||
settings.beginGroup("Language");
|
||||
QStringList langs = settings.value("acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList();
|
||||
settings.endGroup();
|
||||
|
||||
mApp->webProfile()->setHttpAcceptLanguage(AcceptLanguage::generateHeader(langs));
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ public:
|
||||
void installUrlInterceptor(UrlInterceptor *interceptor);
|
||||
void removeUrlInterceptor(UrlInterceptor *interceptor);
|
||||
|
||||
void loadSettings();
|
||||
|
||||
private:
|
||||
NetworkUrlInterceptor *m_urlInterceptor;
|
||||
QHash<QString, QWebEngineCertificateError::Error> m_ignoredSslErrors;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "ui_acceptlanguage.h"
|
||||
#include "ui_addacceptlanguage.h"
|
||||
#include "mainapplication.h"
|
||||
#include "networkmanager.h"
|
||||
#include "settings.h"
|
||||
|
||||
QStringList AcceptLanguage::defaultLanguage()
|
||||
@ -216,6 +217,8 @@ void AcceptLanguage::accept()
|
||||
settings.beginGroup("Language");
|
||||
settings.setValue("acceptLanguage", langs);
|
||||
|
||||
mApp->networkManager()->loadSettings();
|
||||
|
||||
QDialog::close();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user