mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
SiteSettings: Fix default cookies permission error
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
aa108d1f69
commit
7816ea95b7
@ -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:
|
||||
|
@ -124,6 +124,7 @@ private:
|
||||
|
||||
|
||||
QMap<QWebEnginePage::Feature, Permission> defaultFeatures;
|
||||
SiteSettingsManager::Permission m_defaultCookies;
|
||||
|
||||
QString attributesSql;
|
||||
QString everythingSql;
|
||||
|
Loading…
Reference in New Issue
Block a user