From 322a23c0cf4da4f1ea6677c1f2e7c860669e4353 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Wed, 18 Dec 2024 21:04:49 +0100 Subject: [PATCH] Preferences: Fix editing per site user agent Signed-off-by: Juraj Oravec --- src/lib/other/useragentmanager.cpp | 3 ++- src/lib/preferences/useragentdialog.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/other/useragentmanager.cpp b/src/lib/other/useragentmanager.cpp index 35078ef3f..28ad99c9f 100644 --- a/src/lib/other/useragentmanager.cpp +++ b/src/lib/other/useragentmanager.cpp @@ -44,8 +44,9 @@ void UserAgentManager::loadSettings() QStringList userAgentsList = settings.value(QSL("UserAgentsList"), QStringList()).toStringList(); settings.endGroup(); - m_usePerDomainUserAgent = (m_usePerDomainUserAgent && domainList.count() == userAgentsList.count()); + m_usePerDomainUserAgent = (m_usePerDomainUserAgent && (domainList.count() == userAgentsList.count())); + m_userAgentsList.clear(); if (m_usePerDomainUserAgent) { for (int i = 0; i < domainList.count(); ++i) { m_userAgentsList[domainList.at(i)] = userAgentsList.at(i); diff --git a/src/lib/preferences/useragentdialog.cpp b/src/lib/preferences/useragentdialog.cpp index 9bf44b4da..78e171d5a 100644 --- a/src/lib/preferences/useragentdialog.cpp +++ b/src/lib/preferences/useragentdialog.cpp @@ -176,6 +176,7 @@ void UserAgentDialog::accept() settings.setValue(QSL("DomainList"), domainList); settings.setValue(QSL("UserAgentsList"), userAgentsList); settings.endGroup(); + settings.sync(); m_manager->loadSettings(); mApp->networkManager()->loadSettings();