1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

SiteSettings: Fix default cookies permission error

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2024-06-23 22:48:09 +02:00
parent aa108d1f69
commit 7816ea95b7
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
2 changed files with 8 additions and 8 deletions

View File

@ -58,6 +58,7 @@ const QList<QWebEnginePage::Feature> supportedFeatures = {
SiteSettingsManager::SiteSettingsManager ( QObject* parent ) SiteSettingsManager::SiteSettingsManager ( QObject* parent )
: QObject(parent) : QObject(parent)
, m_defaultCookies(Deny)
{ {
prepareSqls(); prepareSqls();
loadSettings(); loadSettings();
@ -75,6 +76,10 @@ void SiteSettingsManager::loadSettings()
defaultFeatures[feature] = intToPermission(settings.value(featureToSqlColumn(feature), Ask).toInt()); defaultFeatures[feature] = intToPermission(settings.value(featureToSqlColumn(feature), Ask).toInt());
} }
settings.endGroup(); settings.endGroup();
settings.beginGroup(QSL("Cookie-Settings"));
m_defaultCookies = settings.value(QSL("allowCookies"), true).toBool() ? Allow : Deny;
settings.endGroup();
} }
void SiteSettingsManager::saveSettings() void SiteSettingsManager::saveSettings()
@ -224,14 +229,8 @@ SiteSettingsManager::Permission SiteSettingsManager::getPermission(const QWebEng
SiteSettingsManager::Permission SiteSettingsManager::getDefaultPermission(const SiteSettingsManager::PageOptions option) SiteSettingsManager::Permission SiteSettingsManager::getDefaultPermission(const SiteSettingsManager::PageOptions option)
{ {
switch (option) { switch (option) {
case poAllowCookies: { case poAllowCookies:
Settings settings; return m_defaultCookies;
settings.beginGroup(QSL("Cookie-Settings"));
auto defaultCookies = settings.value(QSL("allowCookies"), true).toBool() ? Allow : Deny;
settings.endGroup();
return defaultCookies;
}
// so far not implemented // so far not implemented
case poZoomLevel: case poZoomLevel:
default: default:

View File

@ -124,6 +124,7 @@ private:
QMap<QWebEnginePage::Feature, Permission> defaultFeatures; QMap<QWebEnginePage::Feature, Permission> defaultFeatures;
SiteSettingsManager::Permission m_defaultCookies;
QString attributesSql; QString attributesSql;
QString everythingSql; QString everythingSql;