1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +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 )
: 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:

View File

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