Commit 496fa918 authored by Laurent Montel's avatar Laurent Montel 😁

Add QWebEnginePage

parent c00bd79a
...@@ -19,8 +19,12 @@ ...@@ -19,8 +19,12 @@
#include "scamdetectionwebengine.h" #include "scamdetectionwebengine.h"
#include "scamcheckshorturlmanager.h" #include "scamcheckshorturlmanager.h"
#include "scamdetectiondetailsdialog.h" #include "scamdetectiondetailsdialog.h"
#include "settings/messageviewersettings.h"
#include <KLocalizedString>
#include <QPointer> #include <QPointer>
#include <QWebEnginePage>
using namespace MessageViewer; using namespace MessageViewer;
...@@ -52,6 +56,19 @@ ScamCheckShortUrl *ScamDetectionWebEngine::scamCheckShortUrl() const ...@@ -52,6 +56,19 @@ ScamCheckShortUrl *ScamDetectionWebEngine::scamCheckShortUrl() const
return MessageViewer::ScamCheckShortUrlManager::self()->scamCheckShortUrl(); return MessageViewer::ScamCheckShortUrlManager::self()->scamCheckShortUrl();
} }
void ScamDetectionWebEngine::scanPage(QWebEnginePage *page)
{
if (MessageViewer::MessageViewerSettings::self()->scamDetectionEnabled()) {
bool foundScam = false;
d->mDetails.clear();
d->mDetails = QLatin1String("<b>") + i18n("Details:") + QLatin1String("</b><ul>");
//TODO
if (foundScam) {
Q_EMIT messageMayBeAScam();
}
}
}
#if 0 //TODO #if 0 //TODO
void ScamDetection::scanPage(QWebFrame *frame) void ScamDetection::scanPage(QWebFrame *frame)
{ {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <QObject> #include <QObject>
class QWebEnginePage;
namespace MessageViewer namespace MessageViewer
{ {
class ScamCheckShortUrl; class ScamCheckShortUrl;
...@@ -32,6 +33,7 @@ public: ...@@ -32,6 +33,7 @@ public:
~ScamDetectionWebEngine(); ~ScamDetectionWebEngine();
ScamCheckShortUrl *scamCheckShortUrl() const; ScamCheckShortUrl *scamCheckShortUrl() const;
void scanPage(QWebEnginePage *page);
public Q_SLOTS: public Q_SLOTS:
void showDetails(); void showDetails();
......
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