Commit 80822445 authored by Laurent Montel's avatar Laurent Montel 😁

Set webengineview

parent 26ee682b
......@@ -20,7 +20,8 @@
#include "lib/adblockmanager.h"
AdblockInterceptorInterface::AdblockInterceptorInterface(QObject *parent)
: MessageViewer::NetworkPluginUrlInterceptorInterface(parent)
: MessageViewer::NetworkPluginUrlInterceptorInterface(parent),
mWebEngineView(Q_NULLPTR)
{
mAdblockManager = new AdBlock::AdblockManager(this);
}
......@@ -42,7 +43,7 @@ void AdblockInterceptorInterface::interceptRequest(QWebEngineUrlRequestInfo &inf
QList<QAction *> AdblockInterceptorInterface::actions() const
{
return {};
return mActionsList;
}
void AdblockInterceptorInterface::createActions(KActionCollection *ac)
......@@ -52,3 +53,13 @@ void AdblockInterceptorInterface::createActions(KActionCollection *ac)
}
//TODO
}
QWebEngineView *AdblockInterceptorInterface::webEngineView() const
{
return mWebEngineView;
}
void AdblockInterceptorInterface::setWebEngineView(QWebEngineView *webEngineView)
{
mWebEngineView = webEngineView;
}
......@@ -19,6 +19,7 @@
#define ADBLOCKINTERCEPTORINTERFACE_H
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
class QWebEngineView;
namespace AdBlock
{
class AdblockManager;
......@@ -33,8 +34,13 @@ public:
void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE;
QList<QAction *> actions() const Q_DECL_OVERRIDE;
void createActions(KActionCollection *ac) Q_DECL_OVERRIDE;
QWebEngineView *webEngineView() const;
void setWebEngineView(QWebEngineView *webEngineView);
private:
AdBlock::AdblockManager *mAdblockManager;
QWebEngineView *mWebEngineView;
};
#endif // ADBLOCKINTERCEPTORINTERFACE_H
......@@ -35,7 +35,8 @@ AdblockPluginUrlInterceptor::~AdblockPluginUrlInterceptor()
MessageViewer::NetworkPluginUrlInterceptorInterface *AdblockPluginUrlInterceptor::createInterface(QWebEngineView *webEngine, QObject *parent)
{
return new AdblockInterceptorInterface(parent);
AdblockInterceptorInterface *adblockInterface = new AdblockInterceptorInterface(parent);
return adblockInterface;
}
bool AdblockPluginUrlInterceptor::hasConfigureSupport() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment