summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-04-02 12:07:40 +0200
committerMontel Laurent <[email protected]>2016-04-02 12:07:40 +0200
commitdae0ae58ea7f00cefb873749da7b037505d2ad3f (patch)
tree277a0eed0866b496e976898dd5ab13b6f9c20e7c
parentdb52c92ad30a15799f73c4276f5b08627e95c603 (diff)
We need WebHitTestResult to specify which actions we need
-rw-r--r--CMakeLists.txt2
-rw-r--r--messageviewer/src/viewer/webengine/mailwebengineview.cpp4
-rw-r--r--messageviewer/src/viewer/webengine/mailwebengineview.h2
-rw-r--r--messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.cpp4
-rw-r--r--messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.h3
-rw-r--r--messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.cpp3
-rw-r--r--messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h3
-rw-r--r--messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.cpp12
-rw-r--r--messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.h3
9 files changed, 21 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d092b5..94a3553 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(MESSAGELIB_LIB_VERSION "5.2.50")
+set(MESSAGELIB_LIB_VERSION "5.2.51")
set(KF5_VERSION "5.19.0")
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.cpp b/messageviewer/src/viewer/webengine/mailwebengineview.cpp
index 7a654cc..468fc6d 100644
--- a/messageviewer/src/viewer/webengine/mailwebengineview.cpp
+++ b/messageviewer/src/viewer/webengine/mailwebengineview.cpp
@@ -341,9 +341,9 @@ void MailWebEngineView::setAllowExternalContent(bool b)
}
}
-QList<QAction *> MailWebEngineView::interceptorUrlActions() const
+QList<QAction *> MailWebEngineView::interceptorUrlActions(const MessageViewer::WebHitTestResult &result) const
{
- return d->mNetworkAccessManager->actions();
+ return d->mNetworkAccessManager->actions(result);
}
void MailWebEngineView::slotLoadFinished()
diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.h b/messageviewer/src/viewer/webengine/mailwebengineview.h
index d1fc53b..271ae98 100644
--- a/messageviewer/src/viewer/webengine/mailwebengineview.h
+++ b/messageviewer/src/viewer/webengine/mailwebengineview.h
@@ -58,7 +58,7 @@ public:
void setAllowExternalContent(bool b);
- QList<QAction *> interceptorUrlActions() const;
+ QList<QAction *> interceptorUrlActions(const MessageViewer::WebHitTestResult &result) const;
void toggleFullAddressList(const QString &field, const boost::function<QString ()> &delayedHtml, bool doShow);
public Q_SLOTS:
diff --git a/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.cpp b/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.cpp
index b5b0174..f3acbb2 100644
--- a/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.cpp
+++ b/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.cpp
@@ -60,11 +60,11 @@ void NetworkAccessManagerWebEngine::addInterceptor(MessageViewer::NetworkPluginU
d->mNetworkUrlInterceptor->addInterceptor(interceptor);
}
-QList<QAction *> NetworkAccessManagerWebEngine::actions() const
+QList<QAction *> NetworkAccessManagerWebEngine::actions(const MessageViewer::WebHitTestResult &result) const
{
QList<QAction *> actions;
Q_FOREACH (MessageViewer::NetworkPluginUrlInterceptorInterface *interface, d->mManager->interfaceList()) {
- actions.append(interface->actions());
+ actions.append(interface->actions(result));
}
return actions;
}
diff --git a/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.h b/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.h
index 42c51b9..5c46409 100644
--- a/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.h
+++ b/messageviewer/src/webengine/networkmanager/networkaccessmanagerwebengine.h
@@ -25,6 +25,7 @@ class QWebEngineView;
class QAction;
namespace MessageViewer
{
+class WebHitTestResult;
class NetworkPluginUrlInterceptorInterface;
class NetworkAccessManagerWebEnginePrivate;
class NetworkPluginUrlInterceptorConfigureWidget;
@@ -36,7 +37,7 @@ public:
explicit NetworkAccessManagerWebEngine(QWebEngineView *webEngine, KActionCollection *ac, QObject *parent = Q_NULLPTR);
~NetworkAccessManagerWebEngine();
void addInterceptor(MessageViewer::NetworkPluginUrlInterceptorInterface *interceptor);
- QList<QAction *> actions() const;
+ QList<QAction *> actions(const MessageViewer::WebHitTestResult &result) const;
QVector<MessageViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting> configureInterceptorList(QWidget *parent = Q_NULLPTR) const;
private:
NetworkAccessManagerWebEnginePrivate *const d;
diff --git a/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.cpp b/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.cpp
index 2af4a6e..633a345 100644
--- a/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.cpp
+++ b/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.cpp
@@ -35,7 +35,8 @@ void NetworkPluginUrlInterceptorInterface::createActions(KActionCollection *ac)
Q_UNUSED(ac);
}
-QList<QAction *> NetworkPluginUrlInterceptorInterface::actions() const
+QList<QAction *> NetworkPluginUrlInterceptorInterface::actions(const MessageViewer::WebHitTestResult &result) const
{
+ Q_UNUSED(result);
return {};
}
diff --git a/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h b/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h
index 19b8588..b26e70c 100644
--- a/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h
+++ b/messageviewer/src/webengine/urlinterceptor/networkpluginurlinterceptorinterface.h
@@ -25,6 +25,7 @@ class KActionCollection;
class QAction;
namespace MessageViewer
{
+class WebHitTestResult;
class MESSAGEVIEWER_EXPORT NetworkPluginUrlInterceptorInterface : public QObject
{
Q_OBJECT
@@ -33,7 +34,7 @@ public:
~NetworkPluginUrlInterceptorInterface();
virtual void createActions(KActionCollection *ac);
- virtual QList<QAction *> actions() const;
+ virtual QList<QAction *> actions(const MessageViewer::WebHitTestResult &result) const;
virtual bool interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
diff --git a/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.cpp b/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.cpp
index ea810b3..9b8a217 100644
--- a/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.cpp
+++ b/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.cpp
@@ -19,6 +19,8 @@
#include "networkurlinterceptormanager.h"
#include "networkurlinterceptorpluginmanager.h"
+#include <MessageViewer/WebHitTestResult>
+
using namespace MessageViewer;
class MessageViewer::NetworkUrlInterceptorManagerPrivate
@@ -30,18 +32,18 @@ public:
createInterfaces(webEngine, ac);
}
- QList<QAction *> actions() const;
+ QList<QAction *> actions(const MessageViewer::WebHitTestResult &result) const;
QVector<NetworkPluginUrlInterceptorConfigureWidgetSetting> configureInterceptorList(QWidget *parent) const;
void createInterfaces(QWebEngineView *webEngine, KActionCollection *ac);
QVector<MessageViewer::NetworkPluginUrlInterceptorInterface *> mListInterface;
NetworkUrlInterceptorManager *q;
};
-QList<QAction *> NetworkUrlInterceptorManagerPrivate::actions() const
+QList<QAction *> NetworkUrlInterceptorManagerPrivate::actions(const MessageViewer::WebHitTestResult &result) const
{
QList<QAction *> lstActions;
Q_FOREACH(MessageViewer::NetworkPluginUrlInterceptorInterface *interface, mListInterface) {
- lstActions.append(interface->actions());
+ lstActions.append(interface->actions(result));
}
return lstActions;
}
@@ -83,9 +85,9 @@ QVector<MessageViewer::NetworkPluginUrlInterceptorInterface *> NetworkUrlInterce
return d->mListInterface;
}
-QList<QAction *> NetworkUrlInterceptorManager::actions() const
+QList<QAction *> NetworkUrlInterceptorManager::actions(const MessageViewer::WebHitTestResult &result) const
{
- return d->actions();
+ return d->actions(result);
}
QVector<NetworkPluginUrlInterceptorConfigureWidgetSetting> NetworkUrlInterceptorManager::configureInterceptorList(QWidget *parent) const
diff --git a/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.h b/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.h
index 843eb4f..1dd6371 100644
--- a/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.h
+++ b/messageviewer/src/webengine/urlinterceptor/networkurlinterceptormanager.h
@@ -25,6 +25,7 @@
namespace MessageViewer
{
+class WebHitTestResult;
class NetworkUrlInterceptorManagerPrivate;
class MESSAGEVIEWER_EXPORT NetworkUrlInterceptorManager : public QObject
{
@@ -34,7 +35,7 @@ public:
~NetworkUrlInterceptorManager();
QVector<NetworkPluginUrlInterceptorInterface *> interfaceList() const;
- QList<QAction *> actions() const;
+ QList<QAction *> actions(const MessageViewer::WebHitTestResult &result) const;
QVector<NetworkPluginUrlInterceptorConfigureWidgetSetting> configureInterceptorList(QWidget *parent) const;
private:
NetworkUrlInterceptorManagerPrivate *const d;