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

Add QWebEnginePage

parent c00bd79a
......@@ -19,8 +19,12 @@
#include "scamdetectionwebengine.h"
#include "scamcheckshorturlmanager.h"
#include "scamdetectiondetailsdialog.h"
#include "settings/messageviewersettings.h"
#include <KLocalizedString>
#include <QPointer>
#include <QWebEnginePage>
using namespace MessageViewer;
......@@ -52,6 +56,19 @@ ScamCheckShortUrl *ScamDetectionWebEngine::scamCheckShortUrl() const
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
void ScamDetection::scanPage(QWebFrame *frame)
{
......
......@@ -20,6 +20,7 @@
#include <QObject>
class QWebEnginePage;
namespace MessageViewer
{
class ScamCheckShortUrl;
......@@ -32,6 +33,7 @@ public:
~ScamDetectionWebEngine();
ScamCheckShortUrl *scamCheckShortUrl() const;
void scanPage(QWebEnginePage *page);
public Q_SLOTS:
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