From cbd3b9fb9635af3c99fcbfa75b8494da1769601f Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Wed, 31 Jan 2024 22:00:43 +0100 Subject: [PATCH] Preferences: Store default site settings values Signed-off-by: Juraj Oravec --- src/lib/other/sitesettingsmanager.cpp | 2 +- src/lib/preferences/preferences.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/other/sitesettingsmanager.cpp b/src/lib/other/sitesettingsmanager.cpp index 7222b7267..bea29e06d 100644 --- a/src/lib/other/sitesettingsmanager.cpp +++ b/src/lib/other/sitesettingsmanager.cpp @@ -277,7 +277,7 @@ SiteSettingsManager::Permission SiteSettingsManager::getDefaultPermission(const return Deny; } - return testAttribute(attribute); + return defaultAttributes[attribute]; } void SiteSettingsManager::setDefaultPermission(const SiteSettingsManager::PageOptions& option, const int& value) diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index bf2e0ca86..731f39667 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -1094,11 +1094,20 @@ void Preferences::saveSettings() settings.setValue(QSL("Password"), ui->proxyPassword->text()); settings.endGroup(); + //SiteSettings + settings.beginGroup(QSL("Site-Settings")); + for (int i = 0; i < ui->siteSettingsList->count(); ++i) { + auto *item = static_cast(ui->siteSettingsList->itemWidget(ui->siteSettingsList->item(i))); + settings.setValue(item->sqlColumn(), item->permission()); + } + settings.endGroup(); + ProfileManager::setStartingProfile(ui->startProfile->currentText()); m_pluginsList->save(); m_themesManager->save(); mApp->cookieJar()->loadSettings(); + mApp->siteSettingsManager()->loadSettings(); mApp->history()->loadSettings(); mApp->reloadSettings(); mApp->desktopNotifications()->loadSettings();