Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PIM Messagelib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
PIM Messagelib
Commits
1297707f
Commit
1297707f
authored
Mar 30, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't call all interceptor if we block it
parent
7a25c61a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
CMakeLists.txt
CMakeLists.txt
+1
-1
messageviewer/src/webengine/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.cpp
...esurlinterceptor/loadexternalreferencesurlinterceptor.cpp
+3
-2
messageviewer/src/webengine/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.h
...ncesurlinterceptor/loadexternalreferencesurlinterceptor.h
+1
-1
messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h
...ine/urlinterceptor/networkpluginurlinterceptorinterface.h
+1
-1
messageviewer/src/webengine/urlinterceptor/networkurlinterceptor.cpp
...er/src/webengine/urlinterceptor/networkurlinterceptor.cpp
+4
-1
No files found.
CMakeLists.txt
View file @
1297707f
...
...
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include
(
ECMQtDeclareLoggingCategory
)
include
(
ECMAddTests
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.4
6
"
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.4
7
"
)
set
(
KF5_VERSION
"5.19.0"
)
set
(
KDEPIMLIBS_LIB_VERSION
"5.2.40"
)
...
...
messageviewer/src/webengine/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.cpp
View file @
1297707f
...
...
@@ -44,14 +44,15 @@ LoadExternalReferencesUrlInterceptor::~LoadExternalReferencesUrlInterceptor()
delete
d
;
}
void
LoadExternalReferencesUrlInterceptor
::
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
bool
LoadExternalReferencesUrlInterceptor
::
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
{
if
(
!
d
->
mAllowLoadExternalReference
)
{
//TODO add more resource type
if
(
info
.
resourceType
()
==
QWebEngineUrlRequestInfo
::
ResourceTypeImage
&&
!
info
.
requestUrl
().
isLocalFile
())
{
info
.
block
(
true
)
;
return
true
;
}
}
return
false
;
}
void
LoadExternalReferencesUrlInterceptor
::
setAllowExternalContent
(
bool
b
)
...
...
messageviewer/src/webengine/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.h
View file @
1297707f
...
...
@@ -30,7 +30,7 @@ public:
explicit
LoadExternalReferencesUrlInterceptor
(
QObject
*
parent
=
Q_NULLPTR
);
~
LoadExternalReferencesUrlInterceptor
();
void
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
Q_DECL_OVERRIDE
;
bool
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
Q_DECL_OVERRIDE
;
void
setAllowExternalContent
(
bool
b
);
bool
allowExternalContent
()
const
;
private:
...
...
messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h
View file @
1297707f
...
...
@@ -35,7 +35,7 @@ public:
virtual
void
createActions
(
KActionCollection
*
ac
);
virtual
QList
<
QAction
*>
actions
()
const
;
virtual
void
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
=
0
;
virtual
bool
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
=
0
;
};
}
#endif // MAILNETWORKPLUGINURLINTERCEPTORINTERFACE_H
messageviewer/src/webengine/urlinterceptor/networkurlinterceptor.cpp
View file @
1297707f
...
...
@@ -47,7 +47,10 @@ void NetworkUrlInterceptorPrivate::addInterceptor(NetworkPluginUrlInterceptorInt
void
NetworkUrlInterceptorPrivate
::
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
{
Q_FOREACH
(
NetworkPluginUrlInterceptorInterface
*
inter
,
listInterceptor
)
{
inter
->
interceptRequest
(
info
);
if
(
inter
->
interceptRequest
(
info
))
{
info
.
block
(
true
);
break
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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