summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-11 06:42:54 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-11 06:42:54 (GMT)
commit9ba38b28fbb381e9f2acda7987ced3b93f07dfd6 (patch)
tree1b228656858746d8bbb61adce7b0efdc6cd33d47
parentd832310a02b9263b216c45275f185984880348c5 (diff)
Use WebEngineViewer::CheckPhishingUrlCache::MalWare too
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp17
-rw-r--r--messageviewer/src/viewer/viewer_p.h1
2 files changed, 15 insertions, 3 deletions
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index e30ae0c..293e4e1 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -1977,6 +1977,10 @@ void ViewerPrivate::checkPhishingUrl()
WebEngineViewer::CheckPhishingUrlCache::UrlStatus status = WebEngineViewer::CheckPhishingUrlCache::self()->urlStatus(mClickedUrl);
if (status == WebEngineViewer::CheckPhishingUrlCache::UrlOk) {
executeRunner(mClickedUrl);
+ } else if (status == WebEngineViewer::CheckPhishingUrlCache::MalWare) {
+ if (urlIsAMalwareButContinue()) {
+ executeRunner(mClickedUrl);
+ }
} else {
MessageViewer::MailCheckPhishingUrlJob *job = new MessageViewer::MailCheckPhishingUrlJob(this);
connect(job, &MessageViewer::MailCheckPhishingUrlJob::result, this, &ViewerPrivate::slotCheckUrl);
@@ -2011,8 +2015,7 @@ void ViewerPrivate::slotCheckUrl(WebEngineViewer::CheckPhishingUrlJob::UrlStatus
WebEngineViewer::CheckPhishingUrlCache::self()->setCheckingUrlResult(url, WebEngineViewer::CheckPhishingUrlCache::UrlOk);
break;
case WebEngineViewer::CheckPhishingUrlJob::MalWare:
- WebEngineViewer::CheckPhishingUrlCache::self()->setCheckingUrlResult(url, WebEngineViewer::CheckPhishingUrlCache::MalWare);
- if (KMessageBox::No == KMessageBox::warningYesNo(mMainWindow, i18n("This web site is a malware, do you want to continue to show it?"), i18n("Malware"))) {
+ if (!urlIsAMalwareButContinue()) {
return;
}
break;
@@ -2020,7 +2023,15 @@ void ViewerPrivate::slotCheckUrl(WebEngineViewer::CheckPhishingUrlJob::UrlStatus
qCWarning(MESSAGEVIEWER_LOG) << "WebEngineViewer::CheckPhishingUrlJob unknown error ";
break;
}
- executeRunner(mClickedUrl);
+ executeRunner(url);
+}
+
+bool ViewerPrivate::urlIsAMalwareButContinue()
+{
+ if (KMessageBox::No == KMessageBox::warningYesNo(mMainWindow, i18n("This web site is a malware, do you want to continue to show it?"), i18n("Malware"))) {
+ return false;
+ }
+ return true;
}
void ViewerPrivate::slotUrlOn(const QString &link)
diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h
index 5978a9d..58af766 100644
--- a/messageviewer/src/viewer/viewer_p.h
+++ b/messageviewer/src/viewer/viewer_p.h
@@ -595,6 +595,7 @@ private:
void replyMessageToAuthor(KMime::Content *atmNode);
void replyMessageToAll(KMime::Content *atmNode);
+ bool urlIsAMalwareButContinue();
public:
MimeTreeParser::NodeHelper *mNodeHelper;
bool mHtmlMailGlobalSetting;