Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Add-ons
Commits
25190c4f
Commit
25190c4f
authored
Mar 13, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix api
parent
5efb99ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
plugins/messageviewerwebengineurlinterceptor/adblock/adblockinterceptorinterface.cpp
...ineurlinterceptor/adblock/adblockinterceptorinterface.cpp
+1
-1
plugins/messageviewerwebengineurlinterceptor/adblock/adblockpluginurlinterceptor.cpp
...ineurlinterceptor/adblock/adblockpluginurlinterceptor.cpp
+0
-1
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/CMakeLists.txt
...rwebengineurlinterceptor/adblock/autotests/CMakeLists.txt
+2
-2
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
...werwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
+2
-1
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
...iewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
+2
-1
No files found.
plugins/messageviewerwebengineurlinterceptor/adblock/adblockinterceptorinterface.cpp
View file @
25190c4f
...
...
@@ -35,7 +35,7 @@ void AdblockInterceptorInterface::interceptRequest(QWebEngineUrlRequestInfo &inf
if
(
!
mAdblockManager
->
isEnabled
())
{
return
;
}
if
(
mAdblockManager
->
interceptRequest
(
info
.
requestUrl
()
))
{
if
(
mAdblockManager
->
interceptRequest
(
info
))
{
info
.
block
(
true
);
}
}
plugins/messageviewerwebengineurlinterceptor/adblock/adblockpluginurlinterceptor.cpp
View file @
25190c4f
...
...
@@ -21,7 +21,6 @@
#include "lib/adblockmanager.h"
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
#include <kpluginfactory.h>
#include <QDebug>
K_PLUGIN_FACTORY_WITH_JSON
(
AdblockPluginUrlInterceptorFactory
,
"messageviewer_adblockurlinterceptor.json"
,
registerPlugin
<
AdblockPluginUrlInterceptor
>
();)
AdblockPluginUrlInterceptor
::
AdblockPluginUrlInterceptor
(
QObject
*
parent
,
const
QList
<
QVariant
>
&
)
...
...
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/CMakeLists.txt
View file @
25190c4f
...
...
@@ -2,7 +2,7 @@
ecm_add_test
(
adblockmanagertest.cpp
TEST_NAME adblockmanagertest
NAME_PREFIX
"messageviewer-urlinterceptor-"
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews
Qt5::WebEngine Qt5::WebEngineWidgets
)
...
...
@@ -16,4 +16,4 @@ set( adblockpluginurlinterceptorconfigurewidgettest_SRCS adblockpluginurlinterce
add_executable
(
adblockpluginurlinterceptorconfigurewidgettest
${
adblockpluginurlinterceptorconfigurewidgettest_SRCS
}
)
add_test
(
adblockpluginurlinterceptorconfigurewidgettest adblockpluginurlinterceptorconfigurewidgettest
)
ecm_mark_as_test
(
adblockpluginurlinterceptorconfigurewidgettest
)
target_link_libraries
(
adblockpluginurlinterceptorconfigurewidgettest Qt5::Test Qt5::Widgets KF5::MessageViewer KF5::ItemViews
)
target_link_libraries
(
adblockpluginurlinterceptorconfigurewidgettest Qt5::Test Qt5::Widgets KF5::MessageViewer KF5::ItemViews
Qt5::WebEngine Qt5::WebEngineWidgets
)
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
View file @
25190c4f
...
...
@@ -65,8 +65,9 @@ bool AdblockManager::isEnabled() const
return
mEnabled
;
}
bool
AdblockManager
::
interceptRequest
(
const
Q
Url
&
url
)
bool
AdblockManager
::
interceptRequest
(
const
Q
WebEngineUrlRequestInfo
&
info
)
{
QUrl
url
=
info
.
requestUrl
();
const
QString
urlString
=
url
.
toString
().
toLower
();
const
QString
host
=
url
.
host
().
toLower
();
const
QString
scheme
=
url
.
scheme
().
toLower
();
...
...
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
View file @
25190c4f
...
...
@@ -19,6 +19,7 @@
#define ADBLOCKMANAGER_H
#include <QObject>
#include <QWebEngineUrlRequestInfo>
#include "adblocklib_export.h"
namespace
AdBlock
{
...
...
@@ -31,7 +32,7 @@ public:
~
AdblockManager
();
bool
isEnabled
()
const
;
bool
interceptRequest
(
const
Q
Url
&
url
);
bool
interceptRequest
(
const
Q
WebEngineUrlRequestInfo
&
info
);
public
Q_SLOTS
:
void
reloadConfig
();
...
...
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