Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
Falkon
Commits
fe875699
Verified
Commit
fe875699
authored
Oct 04, 2022
by
Juraj Oravec
Browse files
Add more Private mode handlings
Signed-off-by:
Juraj Oravec
<
jurajoravec@mailo.com
>
parent
e1d54dff
Pipeline
#241742
skipped
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/lib/other/sitesettingsmanager.cpp
View file @
fe875699
...
...
@@ -240,7 +240,7 @@ void SiteSettingsManager::setImages(const QUrl& url, const int value)
void
SiteSettingsManager
::
setOption
(
const
QString
&
column
,
const
QUrl
&
url
,
const
int
value
)
{
if
(
column
.
isEmpty
())
{
if
(
column
.
isEmpty
()
||
mApp
->
isPrivate
()
)
{
return
;
}
...
...
@@ -278,6 +278,9 @@ SiteSettingsManager::Permission SiteSettingsManager::getPermission(const QString
if
(
column
.
isEmpty
())
{
return
Deny
;
}
if
(
mApp
->
isPrivate
())
{
return
Default
;
}
QSqlQuery
query
(
SqlDatabase
::
instance
()
->
database
());
query
.
prepare
(
QSL
(
"SELECT %1 FROM %2 WHERE server=?"
).
arg
(
column
,
sqlTable
()));
...
...
@@ -640,6 +643,10 @@ SiteSettingsManager::SiteSettings SiteSettingsManager::getSiteSettings(QUrl& url
void
SiteSettingsManager
::
setSiteSettings
(
SiteSettingsManager
::
SiteSettings
&
siteSettings
)
{
if
(
mApp
->
isPrivate
())
{
return
;
}
auto
job
=
new
SqlQueryJob
(
everythingUpdateSql
.
arg
(
sqlTable
()),
this
);
for
(
int
i
=
0
;
i
<
supportedAttribute
.
size
();
++
i
)
{
...
...
src/lib/webengine/webpage.cpp
View file @
fe875699
...
...
@@ -457,11 +457,25 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
const
bool
isWeb
=
url
.
scheme
()
==
QL1S
(
"http"
)
||
url
.
scheme
()
==
QL1S
(
"https"
)
||
url
.
scheme
()
==
QL1S
(
"file"
);
if
(
isWeb
)
{
auto
webAttributes
=
mApp
->
siteSettingsManager
()
->
getWebAttributes
(
url
);
if
(
!
webAttributes
.
empty
())
{
QHash
<
QWebEngineSettings
::
WebAttribute
,
bool
>::
iterator
it
;
for
(
it
=
webAttributes
.
begin
();
it
!=
webAttributes
.
end
();
++
it
)
{
settings
()
->
setAttribute
(
it
.
key
(),
it
.
value
());
if
(
!
mApp
->
isPrivate
())
{
auto
webAttributes
=
mApp
->
siteSettingsManager
()
->
getWebAttributes
(
url
);
if
(
!
webAttributes
.
empty
())
{
QHash
<
QWebEngineSettings
::
WebAttribute
,
bool
>::
iterator
it
;
for
(
it
=
webAttributes
.
begin
();
it
!=
webAttributes
.
end
();
++
it
)
{
settings
()
->
setAttribute
(
it
.
key
(),
it
.
value
());
}
}
else
{
auto
webAttributes
=
mApp
->
siteSettingsManager
()
->
getSupportedAttribute
();
for
(
auto
&
attribute
:
qAsConst
(
webAttributes
))
{
settings
()
->
setAttribute
(
attribute
,
mApp
->
webSettings
()
->
testAttribute
(
attribute
));
}
}
}
else
{
auto
webAttributes
=
mApp
->
siteSettingsManager
()
->
getSupportedAttribute
();
for
(
auto
&
attribute
:
qAsConst
(
webAttributes
))
{
settings
()
->
setAttribute
(
attribute
,
mApp
->
webSettings
()
->
testAttribute
(
attribute
));
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment