diff --git a/src/lib/other/sitesettingsmanager.cpp b/src/lib/other/sitesettingsmanager.cpp index c1548508e..fea44cde4 100644 --- a/src/lib/other/sitesettingsmanager.cpp +++ b/src/lib/other/sitesettingsmanager.cpp @@ -58,6 +58,7 @@ const QList supportedFeatures = { SiteSettingsManager::SiteSettingsManager ( QObject* parent ) : QObject(parent) +, m_defaultCookies(Deny) { prepareSqls(); loadSettings(); @@ -75,6 +76,10 @@ void SiteSettingsManager::loadSettings() defaultFeatures[feature] = intToPermission(settings.value(featureToSqlColumn(feature), Ask).toInt()); } settings.endGroup(); + + settings.beginGroup(QSL("Cookie-Settings")); + m_defaultCookies = settings.value(QSL("allowCookies"), true).toBool() ? Allow : Deny; + settings.endGroup(); } void SiteSettingsManager::saveSettings() @@ -224,14 +229,8 @@ SiteSettingsManager::Permission SiteSettingsManager::getPermission(const QWebEng SiteSettingsManager::Permission SiteSettingsManager::getDefaultPermission(const SiteSettingsManager::PageOptions option) { switch (option) { - case poAllowCookies: { - Settings settings; - settings.beginGroup(QSL("Cookie-Settings")); - auto defaultCookies = settings.value(QSL("allowCookies"), true).toBool() ? Allow : Deny; - settings.endGroup(); - - return defaultCookies; - } + case poAllowCookies: + return m_defaultCookies; // so far not implemented case poZoomLevel: default: diff --git a/src/lib/other/sitesettingsmanager.h b/src/lib/other/sitesettingsmanager.h index a461de6e7..35d02a3ae 100644 --- a/src/lib/other/sitesettingsmanager.h +++ b/src/lib/other/sitesettingsmanager.h @@ -124,6 +124,7 @@ private: QMap defaultFeatures; + SiteSettingsManager::Permission m_defaultCookies; QString attributesSql; QString everythingSql;