1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 10:16:34 +01:00

Preferences: Fix editing per site user agent

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2024-12-18 21:04:49 +01:00
parent fcb3e06379
commit 322a23c0cf
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
2 changed files with 3 additions and 1 deletions

View File

@ -44,8 +44,9 @@ void UserAgentManager::loadSettings()
QStringList userAgentsList = settings.value(QSL("UserAgentsList"), QStringList()).toStringList(); QStringList userAgentsList = settings.value(QSL("UserAgentsList"), QStringList()).toStringList();
settings.endGroup(); settings.endGroup();
m_usePerDomainUserAgent = (m_usePerDomainUserAgent && domainList.count() == userAgentsList.count()); m_usePerDomainUserAgent = (m_usePerDomainUserAgent && (domainList.count() == userAgentsList.count()));
m_userAgentsList.clear();
if (m_usePerDomainUserAgent) { if (m_usePerDomainUserAgent) {
for (int i = 0; i < domainList.count(); ++i) { for (int i = 0; i < domainList.count(); ++i) {
m_userAgentsList[domainList.at(i)] = userAgentsList.at(i); m_userAgentsList[domainList.at(i)] = userAgentsList.at(i);

View File

@ -176,6 +176,7 @@ void UserAgentDialog::accept()
settings.setValue(QSL("DomainList"), domainList); settings.setValue(QSL("DomainList"), domainList);
settings.setValue(QSL("UserAgentsList"), userAgentsList); settings.setValue(QSL("UserAgentsList"), userAgentsList);
settings.endGroup(); settings.endGroup();
settings.sync();
m_manager->loadSettings(); m_manager->loadSettings();
mApp->networkManager()->loadSettings(); mApp->networkManager()->loadSettings();