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
7950fdd4
Commit
7950fdd4
authored
Feb 20, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to implement adblock lib
parent
e633679d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
160 additions
and
0 deletions
+160
-0
plugins/messageviewerwebengineurlinterceptor/adblock/CMakeLists.txt
...ssageviewerwebengineurlinterceptor/adblock/CMakeLists.txt
+1
-0
plugins/messageviewerwebengineurlinterceptor/adblock/adblockinterceptorinterface.cpp
...ineurlinterceptor/adblock/adblockinterceptorinterface.cpp
+5
-0
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/adblockmanagertest.cpp
...neurlinterceptor/adblock/autotests/adblockmanagertest.cpp
+33
-0
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/adblockmanagertest.h
...gineurlinterceptor/adblock/autotests/adblockmanagertest.h
+31
-0
plugins/messageviewerwebengineurlinterceptor/adblock/lib/CMakeLists.txt
...eviewerwebengineurlinterceptor/adblock/lib/CMakeLists.txt
+1
-0
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
...werwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
+49
-0
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
...iewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
+40
-0
plugins/messageviewerwebengineurlinterceptor/adblock/lib/autotests/CMakeLists.txt
...engineurlinterceptor/adblock/lib/autotests/CMakeLists.txt
+0
-0
No files found.
plugins/messageviewerwebengineurlinterceptor/adblock/CMakeLists.txt
View file @
7950fdd4
...
...
@@ -7,6 +7,7 @@ add_library(messageviewer_adblockplugin MODULE ${messageviewer_webengineurlinter
target_link_libraries
(
messageviewer_adblockplugin
KF5::MessageViewer
Qt5::WebEngine Qt5::WebEngineWidgets
)
install
(
TARGETS messageviewer_adblockplugin DESTINATION
${
PLUGIN_INSTALL_DIR
}
/messageviewer
)
...
...
plugins/messageviewerwebengineurlinterceptor/adblock/adblockinterceptorinterface.cpp
View file @
7950fdd4
...
...
@@ -16,6 +16,7 @@
*/
#include "adblockinterceptorinterface.h"
#include <QtWebEngineCore/qwebengineurlrequestinfo.h>
AdblockInterceptorInterface
::
AdblockInterceptorInterface
(
QObject
*
parent
)
:
MessageViewer
::
MailNetworkPluginUrlInterceptorInterface
(
parent
)
...
...
@@ -30,5 +31,9 @@ AdblockInterceptorInterface::~AdblockInterceptorInterface()
void
AdblockInterceptorInterface
::
interceptRequest
(
QWebEngineUrlRequestInfo
&
info
)
{
//TODO enable/disable
const
QString
urlString
=
info
.
requestUrl
().
toString
().
toLower
();
const
QString
host
=
info
.
requestUrl
().
host
().
toLower
();
const
QString
scheme
=
info
.
requestUrl
().
scheme
().
toLower
();
//TODO
}
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/adblockmanagertest.cpp
0 → 100644
View file @
7950fdd4
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "adblockmanagertest.h"
#include <QTest>
AdblockManagerTest
::
AdblockManagerTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
AdblockManagerTest
::~
AdblockManagerTest
()
{
}
QTEST_MAIN
(
AdblockManagerTest
)
plugins/messageviewerwebengineurlinterceptor/adblock/autotests/adblockmanagertest.h
0 → 100644
View file @
7950fdd4
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ADBLOCKMANAGERTEST_H
#define ADBLOCKMANAGERTEST_H
#include <QObject>
class
AdblockManagerTest
:
public
QObject
{
Q_OBJECT
public:
explicit
AdblockManagerTest
(
QObject
*
parent
=
Q_NULLPTR
);
~
AdblockManagerTest
();
};
#endif // ADBLOCKMANAGERTEST_H
plugins/messageviewerwebengineurlinterceptor/adblock/lib/CMakeLists.txt
0 → 100644
View file @
7950fdd4
add_subdirectory
(
autotests
)
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.cpp
0 → 100644
View file @
7950fdd4
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "adblockmanager.h"
using
namespace
AdBlock
;
AdblockManager
::
AdblockManager
(
QObject
*
parent
)
:
QObject
(
parent
),
mEnabled
(
false
)
{
}
AdblockManager
::~
AdblockManager
()
{
}
void
AdblockManager
::
reloadConfig
()
{
//TODO
}
bool
AdblockManager
::
isEnabled
()
const
{
return
mEnabled
;
}
bool
AdblockManager
::
interceptRequest
(
const
QString
&
urlEncoded
,
const
QString
&
host
,
const
&
scheme
)
{
//TODO
return
false
;
}
plugins/messageviewerwebengineurlinterceptor/adblock/lib/adblockmanager.h
0 → 100644
View file @
7950fdd4
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ADBLOCKMANAGER_H
#define ADBLOCKMANAGER_H
#include <QObject>
namespace
AdBlock
{
class
AdblockManager
:
public
QObject
{
Q_OBJECT
public:
explicit
AdblockManager
(
QObject
*
parent
=
Q_NULLPTR
);
~
AdblockManager
();
void
reloadConfig
();
bool
isEnabled
()
const
;
bool
interceptRequest
(
const
QString
&
urlEncoded
,
const
QString
&
host
,
const
&
scheme
);
private:
bool
mEnabled
;
};
}
#endif // ADBLOCKMANAGER_H
plugins/messageviewerwebengineurlinterceptor/adblock/lib/autotests/CMakeLists.txt
0 → 100644
View file @
7950fdd4
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