Commit b39902b6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make dkim support by default. Qca is required now

parent 820d1332
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.13.56")
set(PIM_VERSION "5.13.57")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -31,9 +31,6 @@ set_package_properties(Qca-qt5 PROPERTIES DESCRIPTION "Qt Cryptographic Architec
URL "https:/download.kde.org/stable/qca-qt5" TYPE REQUIRED
PURPOSE "Needed for dkim support.")
if (${Qca-qt5_FOUND})
set(USE_DKIM_CHECKER 1)
endif()
configure_file(config-messageviewer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-messageviewer.h)
......
#cmakedefine HAVE_SYS_INOTIFY_H 1
#cmakedefine USE_DKIM_CHECKER 1
......@@ -23,24 +23,18 @@
#include <KConfig>
#include <KConfigGroup>
#include <QRegularExpression>
#ifdef USE_DKIM_CHECKER
#include <QtCrypto>
#endif
using namespace MessageViewer;
DKIMManagerKey::DKIMManagerKey(QObject *parent)
: QObject(parent)
{
#ifdef USE_DKIM_CHECKER
mQcaInitializer = new QCA::Initializer(QCA::Practical, 64);
#endif
loadKeys();
}
DKIMManagerKey::~DKIMManagerKey()
{
#ifdef USE_DKIM_CHECKER
delete mQcaInitializer;
#endif
saveKeys();
}
......
......@@ -24,11 +24,9 @@
#include "messageviewer_export.h"
#include "config-messageviewer.h"
#include <QVector>
#ifdef USE_DKIM_CHECKER
namespace QCA {
class Initializer;
}
#endif
namespace MessageViewer {
/**
* @brief The KeyInfo struct
......@@ -77,9 +75,7 @@ public:
Q_REQUIRED_RESULT QString keyValue(const QString &selector, const QString &domain);
private:
QVector<KeyInfo> mKeys;
#ifdef USE_DKIM_CHECKER
QCA::Initializer *mQcaInitializer = nullptr;
#endif
};
}
Q_DECLARE_TYPEINFO(MessageViewer::KeyInfo, Q_MOVABLE_TYPE);
......
......@@ -35,9 +35,7 @@
#include "viewer/mimeparttree/mimetreemodel.h"
#include "viewer/mimeparttree/mimeparttreeview.h"
#include "widgets/zoomactionmenu.h"
#ifdef USE_DKIM_CHECKER
#include "dkim-verify/dkimwidgetinfo.h"
#endif
#include <Akonadi/KMime/MessageParts>
#include <AkonadiCore/itemfetchjob.h>
#include <AkonadiCore/itemfetchscope.h>
......@@ -755,12 +753,9 @@ void Viewer::setWebViewZoomFactor(qreal factor)
d->setWebViewZoomFactor(factor);
}
#ifdef USE_DKIM_CHECKER
MessageViewer::DKIMWidgetInfo *Viewer::dkimWidgetInfo()
{
Q_D(Viewer);
return d->mDkimWidgetInfo;
}
#endif
}
......@@ -52,10 +52,8 @@ class WebHitTestResult;
namespace MessageViewer {
class WebHitTestResult;
#ifdef USE_DKIM_CHECKER
class DKIMWidgetInfo;
class DKIMViewerMenu;
#endif
class AttachmentStrategy;
class HeaderStylePlugin;
class CSSHelper;
......@@ -348,9 +346,7 @@ public:
void hasMultiMessages(bool messages);
void updateShowMultiMessagesButton(bool enablePreviousButton, bool enableNextButton);
#ifdef USE_DKIM_CHECKER
MessageViewer::DKIMWidgetInfo *dkimWidgetInfo();
#endif
Q_SIGNALS:
void moveMessageToTrash();
......
......@@ -146,13 +146,11 @@
#include <grantleetheme/grantleethememanager.h>
#include <grantleetheme/grantleetheme.h>
#ifdef USE_DKIM_CHECKER
#include "dkim-verify/dkimwidgetinfo.h"
#include "dkim-verify/dkimmanager.h"
#include "dkim-verify/dkimresultattribute.h"
#include "dkim-verify/dkimviewermenu.h"
#include "dkim-verify/dkimmanagerulesdialog.h"
#endif
using namespace boost;
using namespace MailTransport;
......@@ -194,9 +192,7 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
}
mMessageViewerRenderer = new MessageViewerRenderer;
#ifdef USE_DKIM_CHECKER
mDkimWidgetInfo = new MessageViewer::DKIMWidgetInfo(mMainWindow);
#endif
if (_k_attributeInitialized.testAndSetAcquire(0, 1)) {
Akonadi::AttributeFactory::registerAttribute<MessageViewer::MessageDisplayFormatAttribute>();
Akonadi::AttributeFactory::registerAttribute<MessageViewer::ScamAttribute>();
......@@ -243,9 +239,7 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
fs.fetchAttribute<MailTransport::ErrorAttribute>();
fs.fetchAttribute<MessageViewer::MessageDisplayFormatAttribute>();
fs.fetchAttribute<MessageViewer::ScamAttribute>();
#ifdef USE_DKIM_CHECKER
fs.fetchAttribute<MessageViewer::DKIMResultAttribute>();
#endif
mMonitor.setItemFetchScope(fs);
connect(&mMonitor, &Akonadi::Monitor::itemChanged,
this, &ViewerPrivate::slotItemChanged);
......@@ -1198,9 +1192,7 @@ void ViewerPrivate::printPreviewMessage(const Akonadi::Item &message)
void ViewerPrivate::resetStateForNewMessage()
{
#ifdef USE_DKIM_CHECKER
mDkimWidgetInfo->clear();
#endif
mHtmlLoadExtOverride = false;
mClickedUrl.clear();
mImageUrl.clear();
......@@ -1278,7 +1270,6 @@ void ViewerPrivate::setMessageItem(const Akonadi::Item &item, MimeTreeParser::Up
}
return;
}
#ifdef USE_DKIM_CHECKER
if (!mPrinting) {
if (MessageViewer::MessageViewerSettings::self()->enabledDkim()) {
if (messageIsInSpecialFolder()) {
......@@ -1289,7 +1280,6 @@ void ViewerPrivate::setMessageItem(const Akonadi::Item &item, MimeTreeParser::Up
}
}
}
#endif
setMessageInternal(mMessageItem.payload<KMime::Message::Ptr>(), updateMode);
}
......@@ -3108,7 +3098,6 @@ void ViewerPrivate::updateShowMultiMessagesButton(bool enablePreviousButton, boo
mShowNextMessageWidget->updateButton(enablePreviousButton, enableNextButton);
}
#ifdef USE_DKIM_CHECKER
DKIMViewerMenu *ViewerPrivate::dkimViewerMenu()
{
if (MessageViewer::MessageViewerSettings::self()->enabledDkim()) {
......@@ -3133,5 +3122,3 @@ DKIMViewerMenu *ViewerPrivate::dkimViewerMenu()
}
return nullptr;
}
#endif
......@@ -66,12 +66,10 @@ namespace MimeTreeParser {
class ObjectTreeParser;
class NodeHelper;
}
#ifdef USE_DKIM_CHECKER
namespace MessageViewer {
class DKIMWidgetInfo;
class DKIMViewerMenu;
}
#endif
namespace WebEngineViewer {
class WebHitTestResult;
class FindBarWebEngineView;
......@@ -437,9 +435,7 @@ public:
void recreateCssHelper();
void hasMultiMessages(bool messages);
void updateShowMultiMessagesButton(bool enablePreviousButton, bool enableNextButton);
#ifdef USE_DKIM_CHECKER
MessageViewer::DKIMViewerMenu *dkimViewerMenu();
#endif
private Q_SLOTS:
void slotActivatePlugin(MessageViewer::ViewerPluginInterface *interface);
void slotModifyItemDone(KJob *job);
......@@ -695,10 +691,8 @@ public:
QVector<QPointer<MessageViewer::MailSourceWebEngineViewer> > mListMailSourceViewer;
WebEngineViewer::LocalDataBaseManager *mPhishingDatabase = nullptr;
MessageViewer::ShowNextMessageWidget *mShowNextMessageWidget = nullptr;
#ifdef USE_DKIM_CHECKER
MessageViewer::DKIMWidgetInfo *mDkimWidgetInfo = nullptr;
MessageViewer::DKIMViewerMenu *mDkimViewerMenu = nullptr;
#endif
MessageViewer::MessageViewerRenderer *mMessageViewerRenderer = nullptr;
};
}
......
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