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
K
KDE PIM Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
KDE PIM Add-ons
Commits
2308a398
Commit
2308a398
authored
Jul 07, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue to implement it
parent
e77684a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
8 deletions
+21
-8
plugins/webengineurlinterceptor/adblock/lib/adblockmanager.cpp
...ns/webengineurlinterceptor/adblock/lib/adblockmanager.cpp
+5
-5
plugins/webengineurlinterceptor/adblock/lib/adblockmanager.h
plugins/webengineurlinterceptor/adblock/lib/adblockmanager.h
+3
-0
plugins/webengineurlinterceptor/adblock/lib/adblockmatcher.cpp
...ns/webengineurlinterceptor/adblock/lib/adblockmatcher.cpp
+10
-3
plugins/webengineurlinterceptor/adblock/lib/adblockmatcher.h
plugins/webengineurlinterceptor/adblock/lib/adblockmatcher.h
+3
-0
No files found.
plugins/webengineurlinterceptor/adblock/lib/adblockmanager.cpp
View file @
2308a398
...
...
@@ -48,8 +48,7 @@ AdblockManager *AdblockManager::self()
}
AdblockManager
::
AdblockManager
(
QObject
*
parent
)
:
QObject
(
parent
),
mEnabled
(
false
)
:
QObject
(
parent
)
{
mAdBlockMatcher
=
new
AdBlockMatcher
(
this
);
reloadConfig
();
...
...
@@ -62,14 +61,15 @@ AdblockManager::~AdblockManager()
void
AdblockManager
::
reloadConfig
()
{
mEnabled
=
AdBlock
::
AdBlockSettings
::
self
()
->
adBlockEnabled
();
qDebug
()
<<
" void AdblockManager::reloadConfig()"
<<
mEnabled
<<
" "
<<
this
;
bool
enabled
=
AdBlock
::
AdBlockSettings
::
self
()
->
adBlockEnabled
();
enabledChanged
(
enabled
);
qDebug
()
<<
" void AdblockManager::reloadConfig()"
<<
enabled
<<
" "
<<
this
;
//TODO
}
bool
AdblockManager
::
isEnabled
()
const
{
return
m
Enabled
;
return
m
AdBlockMatcher
->
isEnabled
()
;
}
bool
AdblockManager
::
interceptRequest
(
const
QWebEngineUrlRequestInfo
&
info
)
...
...
plugins/webengineurlinterceptor/adblock/lib/adblockmanager.h
View file @
2308a398
...
...
@@ -37,6 +37,9 @@ public:
bool
interceptRequest
(
const
QWebEngineUrlRequestInfo
&
info
);
Q_SIGNALS:
void
enabledChanged
(
bool
);
public
Q_SLOTS
:
void
reloadConfig
();
...
...
plugins/webengineurlinterceptor/adblock/lib/adblockmatcher.cpp
View file @
2308a398
...
...
@@ -41,9 +41,10 @@
using
namespace
AdBlock
;
AdBlockMatcher
::
AdBlockMatcher
(
AdblockManager
*
manager
)
:
QObject
(
manager
)
,
m_manager
(
manager
)
,
m_manager
(
manager
),
m_enabled
(
false
)
{
//FIXME connect(manager, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool))
);
connect
(
manager
,
&
AdblockManager
::
enabledChanged
,
this
,
&
AdBlockMatcher
::
enabledChanged
);
}
AdBlockMatcher
::~
AdBlockMatcher
()
...
...
@@ -145,6 +146,11 @@ QString AdBlockMatcher::elementHidingRulesForDomain(const QString &domain) const
return
rules
;
}
bool
AdBlockMatcher
::
isEnabled
()
const
{
return
m_enabled
;
}
void
AdBlockMatcher
::
update
()
{
clear
();
...
...
@@ -248,7 +254,8 @@ void AdBlockMatcher::clear()
void
AdBlockMatcher
::
enabledChanged
(
bool
enabled
)
{
if
(
enabled
)
{
m_enabled
=
enabled
;
if
(
m_enabled
)
{
update
();
}
else
{
clear
();
...
...
plugins/webengineurlinterceptor/adblock/lib/adblockmatcher.h
View file @
2308a398
...
...
@@ -63,6 +63,8 @@ public:
QString
elementHidingRules
()
const
;
QString
elementHidingRulesForDomain
(
const
QString
&
domain
)
const
;
bool
isEnabled
()
const
;
public
Q_SLOTS
:
void
update
();
void
clear
();
...
...
@@ -83,6 +85,7 @@ private:
QString
m_elementHidingRules
;
AdBlockSearchTree
m_networkBlockTree
;
AdBlockSearchTree
m_networkExceptionTree
;
bool
m_enabled
;
};
}
...
...
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