summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-04 22:22:13 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-04 22:22:13 (GMT)
commited494bfdb7ab34d049a73ad4208977c8869b2ba4 (patch)
tree3ededdcca05a80adcac6dc1517de8638cbcd1196
parent95896d8864831c476de579bff47cc5646cf160f3 (diff)
Add settings to check or not url
-rw-r--r--messageviewer/src/settings/messageviewer.kcfg.cmake5
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp14
2 files changed, 14 insertions, 5 deletions
diff --git a/messageviewer/src/settings/messageviewer.kcfg.cmake b/messageviewer/src/settings/messageviewer.kcfg.cmake
index daf9b11..21f47a3 100644
--- a/messageviewer/src/settings/messageviewer.kcfg.cmake
+++ b/messageviewer/src/settings/messageviewer.kcfg.cmake
@@ -40,6 +40,11 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
</entry>
</group>
+ <group name="Security">
+ <entry name="CheckPhishingUrl" type="Bool">
+ <default>true</default>
+ </entry>
+ </group>
<group name="Reader">
<entry name="AutoImportKeys" type="Bool">
<default>false</default>
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index ba3000f..eb076a3 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -2010,11 +2010,15 @@ void ViewerPrivate::slotUrlOpen(const QUrl &url)
return;
}
#if 0
- MessageViewer::MailCheckPhishingUrlJob *job = new MessageViewer::MailCheckPhishingUrlJob(this);
- connect(job, &MessageViewer::MailCheckPhishingUrlJob::result, this, &ViewerPrivate::slotCheckUrl);
- job->setUrl(mClickedUrl);
- job->setItem(mMessageItem);
- job->start();
+ if (MessageViewer::MessageViewerSettings::self()->checkPhishingUrl()) {
+ MessageViewer::MailCheckPhishingUrlJob *job = new MessageViewer::MailCheckPhishingUrlJob(this);
+ connect(job, &MessageViewer::MailCheckPhishingUrlJob::result, this, &ViewerPrivate::slotCheckUrl);
+ job->setUrl(mClickedUrl);
+ job->setItem(mMessageItem);
+ job->start();
+ } else {
+ Q_EMIT urlClicked(mMessageItem, mClickedUrl);
+ }
#else
Q_EMIT urlClicked(mMessageItem, mClickedUrl);
#endif