Commit 57426b3f authored by Laurent Montel's avatar Laurent Montel 😁

Use new WebEngineViewer

parent 03aee9c6
......@@ -46,6 +46,7 @@ option(QTWEBENGINE_SUPPORT_OPTION "Enable support for QtWebEngine. False by defa
if (QTWEBENGINE_SUPPORT_OPTION)
set(QT_REQUIRED_MINIMUM_WEBENGINE_VERSION "5.6")
find_package(Qt5 ${QT_REQUIRED_MINIMUM_WEBENGINE_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets)
find_package(KF5WebEngineViewer ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
endif()
......@@ -74,7 +75,7 @@ set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(GRAVATAR_LIB_VERSION "5.2.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.2.40")
set(KTNEF_LIB_VERSION "5.2.40")
set(MESSAGELIB_LIB_VERSION "5.2.55")
set(MESSAGELIB_LIB_VERSION "5.2.56")
find_package(KF5MailCommon ${MAILCOMMN_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -17,6 +17,7 @@ target_link_libraries(messageviewer_adblockplugin
KF5::KIOWidgets
KF5::XmlGui
KF5::I18n
KF5::WebEngineViewer
)
install(TARGETS messageviewer_adblockplugin DESTINATION ${PLUGIN_INSTALL_DIR}/messageviewer)
......
......@@ -24,10 +24,10 @@
#include <QAction>
#include <QPointer>
#include <QWebEngineView>
#include <WebHitTestResult>
#include <WebEngineViewer/WebHitTestResult>
AdblockInterceptorInterface::AdblockInterceptorInterface(QObject *parent)
: MessageViewer::NetworkPluginUrlInterceptorInterface(parent),
: WebEngineViewer::NetworkPluginUrlInterceptorInterface(parent),
mShowBlockableItems(Q_NULLPTR),
mWebEngineView(Q_NULLPTR)
{
......@@ -50,7 +50,7 @@ bool AdblockInterceptorInterface::interceptRequest(QWebEngineUrlRequestInfo &inf
return false;
}
QList<QAction *> AdblockInterceptorInterface::interceptorUrlActions(const MessageViewer::WebHitTestResult &result) const
QList<QAction *> AdblockInterceptorInterface::interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const
{
QList<QAction *> lstAction;
if (mAdblockManager->isEnabled()) {
......
......@@ -18,14 +18,14 @@
#ifndef ADBLOCKINTERCEPTORINTERFACE_H
#define ADBLOCKINTERCEPTORINTERFACE_H
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
#include <MessageViewer/WebHitTestResult>
#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
#include <WebEngineViewer/WebHitTestResult>
class QWebEngineView;
namespace AdBlock
{
class AdblockManager;
}
class AdblockInterceptorInterface : public MessageViewer::NetworkPluginUrlInterceptorInterface
class AdblockInterceptorInterface : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
{
Q_OBJECT
public:
......@@ -33,7 +33,7 @@ public:
~AdblockInterceptorInterface();
bool interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE;
QList<QAction *> interceptorUrlActions(const MessageViewer::WebHitTestResult &result) const Q_DECL_OVERRIDE;
QList<QAction *> interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const Q_DECL_OVERRIDE;
void createActions(KActionCollection *ac) Q_DECL_OVERRIDE;
QWebEngineView *webEngineView() const;
......@@ -44,7 +44,7 @@ private Q_SLOTS:
void slotShowBlockableElement();
private:
mutable MessageViewer::WebHitTestResult mCurrentWebHitTest;
mutable WebEngineViewer::WebHitTestResult mCurrentWebHitTest;
QAction *mShowBlockableItems;
QAction *mBlockImage;
AdBlock::AdblockManager *mAdblockManager;
......
......@@ -19,13 +19,13 @@
#include "adblockinterceptorinterface.h"
#include "../lib/widgets/adblockpluginurlinterceptorconfigurewidget.h"
#include "lib/adblockmanager.h"
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
#include <kpluginfactory.h>
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(AdblockPluginUrlInterceptorFactory, "messageviewer_adblockurlinterceptor.json", registerPlugin<AdblockPluginUrlInterceptor>();)
AdblockPluginUrlInterceptor::AdblockPluginUrlInterceptor(QObject *parent, const QList<QVariant> &)
: MessageViewer::NetworkPluginUrlInterceptor(parent)
: WebEngineViewer::NetworkPluginUrlInterceptor(parent)
{
}
......@@ -34,7 +34,7 @@ AdblockPluginUrlInterceptor::~AdblockPluginUrlInterceptor()
}
MessageViewer::NetworkPluginUrlInterceptorInterface *AdblockPluginUrlInterceptor::createInterface(QWebEngineView *webEngine, QObject *parent)
WebEngineViewer::NetworkPluginUrlInterceptorInterface *AdblockPluginUrlInterceptor::createInterface(QWebEngineView *webEngine, QObject *parent)
{
AdblockInterceptorInterface *adblockInterface = new AdblockInterceptorInterface(parent);
adblockInterface->setWebEngineView(webEngine);
......@@ -46,9 +46,9 @@ bool AdblockPluginUrlInterceptor::hasConfigureSupport() const
return true;
}
MessageViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting AdblockPluginUrlInterceptor::createConfigureWidget(QWidget *parent)
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting AdblockPluginUrlInterceptor::createConfigureWidget(QWidget *parent)
{
MessageViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting settings;
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting settings;
settings.name = i18n("AdBlock");
AdBlock::AdblockPluginUrlInterceptorConfigureWidget *configureWidget = new AdBlock::AdblockPluginUrlInterceptorConfigureWidget(parent);
......
......@@ -18,7 +18,7 @@
#ifndef ADBLOCKPLUGINURLINTERCEPTOR_H
#define ADBLOCKPLUGINURLINTERCEPTOR_H
#include <MessageViewer/NetworkPluginUrlInterceptor>
#include <WebEngineViewer/NetworkPluginUrlInterceptor>
#include <QVariant>
class QAction;
class QWebEngineView;
......@@ -27,17 +27,17 @@ namespace MessageViewer
class NetworkPluginUrlInterceptorInterface;
class NetworkPluginUrlInterceptorConfigureWidget;
}
class AdblockPluginUrlInterceptor : public MessageViewer::NetworkPluginUrlInterceptor
class AdblockPluginUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptor
{
Q_OBJECT
public:
explicit AdblockPluginUrlInterceptor(QObject *parent = Q_NULLPTR, const QList<QVariant> & = QList<QVariant>());
~AdblockPluginUrlInterceptor();
MessageViewer::NetworkPluginUrlInterceptorInterface *createInterface(QWebEngineView *webEngine, QObject *parent) Q_DECL_OVERRIDE;
WebEngineViewer::NetworkPluginUrlInterceptorInterface *createInterface(QWebEngineView *webEngine, QObject *parent) Q_DECL_OVERRIDE;
bool hasConfigureSupport() const Q_DECL_OVERRIDE;
MessageViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting createConfigureWidget(QWidget *parent) Q_DECL_OVERRIDE;
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting createConfigureWidget(QWidget *parent) Q_DECL_OVERRIDE;
};
#endif // ADBLOCKPLUGINURLINTERCEPTOR_H
......@@ -4,7 +4,7 @@ ecm_qt_declare_logging_category(messageviewer_adblock_test_common_SRCS HEADER ad
ecm_add_test(adblockmanagertest.cpp ${messageviewer_adblock_test_common_SRCS}
TEST_NAME adblockmanagertest
NAME_PREFIX "messageviewer-urlinterceptor-"
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n KF5::WebEngineViewer
)
......@@ -12,4 +12,5 @@ set( adblockpluginurlinterceptortest_SRCS ${messageviewer_adblock_test_common_SR
add_executable( adblockpluginurlinterceptortest ${adblockpluginurlinterceptortest_SRCS})
add_test(adblockpluginurlinterceptortest adblockpluginurlinterceptortest)
ecm_mark_as_test(adblockpluginurlinterceptortest)
target_link_libraries( adblockpluginurlinterceptortest Qt5::Test Qt5::Widgets adblocklibprivate KF5::MessageViewer Qt5::WebEngine Qt5::WebEngineWidgets KF5::ItemViews KF5::KIOWidgets KF5::XmlGui KF5::I18n)
target_link_libraries( adblockpluginurlinterceptortest Qt5::Test Qt5::Widgets adblocklibprivate KF5::MessageViewer
Qt5::WebEngine Qt5::WebEngineWidgets KF5::ItemViews KF5::KIOWidgets KF5::XmlGui KF5::I18n KF5::WebEngineViewer)
......@@ -34,6 +34,7 @@ PRIVATE
KF5::PimCommon
KF5::MessageViewer
KF5::KIOWidgets
KF5::WebEngineViewer
)
set_target_properties(adblocklibprivate
......
......@@ -6,11 +6,13 @@ set( adblockpluginurlinterceptorconfigurewidgettest_SRCS ${messageviewer_adblock
add_executable( adblockpluginurlinterceptorconfigurewidgettest ${adblockpluginurlinterceptorconfigurewidgettest_SRCS})
add_test(adblockpluginurlinterceptorconfigurewidgettest adblockpluginurlinterceptorconfigurewidgettest)
ecm_mark_as_test(adblockpluginurlinterceptorconfigurewidgettest)
target_link_libraries( adblockpluginurlinterceptorconfigurewidgettest adblocklibprivate Qt5::Test Qt5::Widgets KF5::MessageViewer KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n)
target_link_libraries( adblockpluginurlinterceptorconfigurewidgettest adblocklibprivate Qt5::Test Qt5::Widgets KF5::MessageViewer
KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n KF5::WebEngineViewer)
set( adblockblockableitemsdialogtest_SRCS ${messageviewer_adblock_test_common_SRCS} adblockblockableitemsdialogtest.cpp)
add_executable( adblockblockableitemsdialogtest ${adblockblockableitemsdialogtest_SRCS})
add_test(adblockblockableitemsdialogtest adblockblockableitemsdialogtest)
ecm_mark_as_test(adblockblockableitemsdialogtest)
target_link_libraries( adblockblockableitemsdialogtest adblocklibprivate Qt5::Test Qt5::Widgets KF5::I18n KF5::MessageViewer KF5::PimCommon KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::ConfigCore KF5::KIOWidgets)
target_link_libraries( adblockblockableitemsdialogtest adblocklibprivate Qt5::Test Qt5::Widgets KF5::I18n KF5::MessageViewer
KF5::PimCommon KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::ConfigCore KF5::KIOWidgets KF5::WebEngineViewer)
......@@ -18,7 +18,7 @@
#include "adblockblockableitemswidget.h"
#include "adblockcreatefilterdialog.h"
#include "adblockinterceptor_debug.h"
#include <MessageViewer/WebEngineScript>
#include <WebEngineViewer/WebEngineScript>
#include <QVBoxLayout>
#include <KLocalizedString>
......@@ -162,7 +162,7 @@ void AdBlockBlockableItemsWidget::handleSearchBlockableImageItems(const QVariant
}
}
mListItems->setShowDefaultText(mListItems->model()->rowCount() == 0);
mWebEngineView->page()->runJavaScript(MessageViewer::WebEngineScript::findAllScripts(), invoke(this, &AdBlockBlockableItemsWidget::handleSearchBlockableScriptsItems));
mWebEngineView->page()->runJavaScript(WebEngineViewer::WebEngineScript::findAllScripts(), invoke(this, &AdBlockBlockableItemsWidget::handleSearchBlockableScriptsItems));
}
void AdBlockBlockableItemsWidget::handleSearchBlockableScriptsItems(const QVariant &result)
......@@ -193,7 +193,7 @@ void AdBlockBlockableItemsWidget::searchBlockableItems()
{
if (mWebEngineView) {
mListItems->clear();
mWebEngineView->page()->runJavaScript(MessageViewer::WebEngineScript::findAllImages(), invoke(this, &AdBlockBlockableItemsWidget::handleSearchBlockableImageItems));
mWebEngineView->page()->runJavaScript(WebEngineViewer::WebEngineScript::findAllImages(), invoke(this, &AdBlockBlockableItemsWidget::handleSearchBlockableImageItems));
}
}
......
......@@ -23,7 +23,7 @@
using namespace AdBlock;
AdblockPluginUrlInterceptorConfigureWidget::AdblockPluginUrlInterceptorConfigureWidget(QWidget *parent)
: MessageViewer::NetworkPluginUrlInterceptorConfigureWidget(parent)
: WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidget(parent)
{
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(0);
......
......@@ -18,7 +18,7 @@
#ifndef ADBLOCKPLUGINURLINTERCEPTORCONFIGUREWIDGET_H
#define ADBLOCKPLUGINURLINTERCEPTORCONFIGUREWIDGET_H
#include <MessageViewer/NetworkPluginUrlInterceptorConfigureWidget>
#include <WebEngineViewer/NetworkPluginUrlInterceptorConfigureWidget>
#include "adblocklib_export.h"
namespace MessageViewer
......@@ -27,7 +27,7 @@ class AdBlockSettingWidget;
}
namespace AdBlock
{
class ADBLOCKLIB_EXPORT AdblockPluginUrlInterceptorConfigureWidget : public MessageViewer::NetworkPluginUrlInterceptorConfigureWidget
class ADBLOCKLIB_EXPORT AdblockPluginUrlInterceptorConfigureWidget : public WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidget
{
Q_OBJECT
public:
......
......@@ -4,6 +4,6 @@ ecm_qt_declare_logging_category(messageviewer_adblock_test_common_SRCS HEADER ad
set(adblockblockableelementgui_SRCS adblockblockableelementgui.cpp ${messageviewer_adblock_test_common_SRCS})
add_executable(adblockblockableelementgui ${adblockblockableelementgui_SRCS})
target_link_libraries(adblockblockableelementgui
KF5::MessageViewer Qt5::WebEngine adblocklibprivate Qt5::WebEngineWidgets KF5::ItemViews KF5::KIOWidgets KF5::MessageViewer
KF5::MessageViewer Qt5::WebEngine adblocklibprivate Qt5::WebEngineWidgets KF5::ItemViews KF5::KIOWidgets KF5::MessageViewer KF5::WebEngineViewer
)
......@@ -16,6 +16,7 @@ target_link_libraries(messageviewer_donottrackplugin
KF5::MessageViewer
Qt5::WebEngine
Qt5::WebEngineWidgets
KF5::WebEngineViewer
)
install(TARGETS messageviewer_donottrackplugin DESTINATION ${PLUGIN_INSTALL_DIR}/messageviewer)
......
......@@ -5,4 +5,4 @@ kconfig_add_kcfg_files(donottrackpluginurlinterceptortest_SRCS
add_executable( donottrackpluginurlinterceptortest ${donottrackpluginurlinterceptortest_SRCS})
add_test(donottrackpluginurlinterceptortest donottrackpluginurlinterceptortest)
ecm_mark_as_test(donottrackpluginurlinterceptortest)
target_link_libraries( donottrackpluginurlinterceptortest Qt5::Test Qt5::Widgets KF5::MessageViewer Qt5::WebEngine Qt5::WebEngineWidgets)
target_link_libraries( donottrackpluginurlinterceptortest Qt5::Test Qt5::Widgets KF5::MessageViewer Qt5::WebEngine Qt5::WebEngineWidgets KF5::WebEngineViewer)
......@@ -20,7 +20,7 @@
#include "donottrack.h"
DoNotTrackInterceptorInterface::DoNotTrackInterceptorInterface(QObject *parent)
: MessageViewer::NetworkPluginUrlInterceptorInterface(parent)
: WebEngineViewer::NetworkPluginUrlInterceptorInterface(parent)
{
}
......
......@@ -18,8 +18,8 @@
#ifndef DONOTTRACKINTERCEPTORINTERFACE_H
#define DONOTTRACKINTERCEPTORINTERFACE_H
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
class DoNotTrackInterceptorInterface : public MessageViewer::NetworkPluginUrlInterceptorInterface
#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
class DoNotTrackInterceptorInterface : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
{
Q_OBJECT
public:
......
......@@ -17,13 +17,13 @@
#include "donottrackpluginurlinterceptor.h"
#include "donottrackinterceptorinterface.h"
#include <MessageViewer/NetworkPluginUrlInterceptorInterface>
#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
#include <kpluginfactory.h>
#include <QDebug>
K_PLUGIN_FACTORY_WITH_JSON(DoNotTrackPluginUrlInterceptorFactory, "messageviewer_donottrackurlinterceptor.json", registerPlugin<DoNotTrackPluginUrlInterceptor>();)
DoNotTrackPluginUrlInterceptor::DoNotTrackPluginUrlInterceptor(QObject *parent, const QList<QVariant> &)
: MessageViewer::NetworkPluginUrlInterceptor(parent)
: WebEngineViewer::NetworkPluginUrlInterceptor(parent)
{
}
......@@ -32,7 +32,7 @@ DoNotTrackPluginUrlInterceptor::~DoNotTrackPluginUrlInterceptor()
}
MessageViewer::NetworkPluginUrlInterceptorInterface *DoNotTrackPluginUrlInterceptor::createInterface(QWebEngineView *webEngine, QObject *parent)
WebEngineViewer::NetworkPluginUrlInterceptorInterface *DoNotTrackPluginUrlInterceptor::createInterface(QWebEngineView *webEngine, QObject *parent)
{
Q_UNUSED(webEngine);
return new DoNotTrackInterceptorInterface(parent);
......
......@@ -18,20 +18,20 @@
#ifndef DONOTTRACKPLUGINURLINTERCEPTOR_H
#define DONOTTRACKPLUGINURLINTERCEPTOR_H
#include <MessageViewer/NetworkPluginUrlInterceptor>
#include <WebEngineViewer/NetworkPluginUrlInterceptor>
#include <QVariant>
namespace MessageViewer
{
class NetworkPluginUrlInterceptorInterface;
}
class DoNotTrackPluginUrlInterceptor : public MessageViewer::NetworkPluginUrlInterceptor
class DoNotTrackPluginUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptor
{
Q_OBJECT
public:
explicit DoNotTrackPluginUrlInterceptor(QObject *parent = Q_NULLPTR, const QList<QVariant> & = QList<QVariant>());
~DoNotTrackPluginUrlInterceptor();
MessageViewer::NetworkPluginUrlInterceptorInterface *createInterface(QWebEngineView *webEngine, QObject *parent) Q_DECL_OVERRIDE;
WebEngineViewer::NetworkPluginUrlInterceptorInterface *createInterface(QWebEngineView *webEngine, QObject *parent) Q_DECL_OVERRIDE;
};
#endif // DONOTTRACKPLUGINURLINTERCEPTOR_H
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