From 180bf92e848da203405fc7c44d1099700c90175c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Lanzend=C3=B6rfer?= Date: Sat, 13 Mar 2021 20:26:44 +0000 Subject: [PATCH] Staging --- .../org.freedesktop.Akonadi.pEpAgent.xml | 3 +- akonadi_pep_agent/pepagent.cpp | 10 +-- akonadi_pep_agent/pepagent.h | 62 +++++++++++++++++++ akonadi_pep_agent/pepmessage.h | 5 ++ 4 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 akonadi_pep_agent/pepmessage.h diff --git a/akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml b/akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml index 115c45e..cb26bc6 100644 --- a/akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml +++ b/akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml @@ -1,12 +1,11 @@ - - + diff --git a/akonadi_pep_agent/pepagent.cpp b/akonadi_pep_agent/pepagent.cpp index 348e313..7303bdd 100644 --- a/akonadi_pep_agent/pepagent.cpp +++ b/akonadi_pep_agent/pepagent.cpp @@ -9,8 +9,6 @@ #include "pepagent_debug.h" #include "pepagentadaptor.h" -#include "qpepmessage.h" // A hack to ram this shit throug QDbus - #include #include #include @@ -323,14 +321,10 @@ void pEpAgent::retrieveCollections() collectionsRetrieved(std::move(collections)); } -void pEpAgent::resetIdentity() -{ - qDebug() << __FUNCTION__ << "Test"; -} - pEpMessage pEpAgent::decryptMessage(const KMime::Message::Ptr &value){ qDebug() << __FUNCTION__ << "Test"; - return m; + pEpMessage ret; + return ret; } AKONADI_RESOURCE_MAIN(pEpAgent) diff --git a/akonadi_pep_agent/pepagent.h b/akonadi_pep_agent/pepagent.h index e69de29..20eabc3 100644 --- a/akonadi_pep_agent/pepagent.h +++ b/akonadi_pep_agent/pepagent.h @@ -0,0 +1,62 @@ +#ifndef PEP_RESOURCE_H +#define PEP_RESOURCE_H + +#include +#include +#include +#include + +#include + +#include "pepagent_p.h" +#include "pepmessage.h" + + +class pEpAgent : + public Akonadi::ResourceBase, + public Akonadi::AgentBase::Observer +{ + Q_OBJECT + +public: + explicit pEpAgent(const QString &id); + ~pEpAgent() = default; + +public Q_SLOTS: + pEpMessage decryptMessage(const KMime::Message::Ptr &value); + +protected Q_SLOTS: + void retrieveCollections() override; + void retrieveItems(const Akonadi::Collection &col) override {}; + +protected: + void itemsReceiviedForFiltering(const Akonadi::Item::List &items); + void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection); + + void mailCollectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &); + void mailCollectionRemoved(const Akonadi::Collection &collection); + void mailCollectionChanged(const Akonadi::Collection &collection); + +private Q_SLOTS: + void slotInstanceRemoved(const Akonadi::AgentInstance &instance); + void slotItemChanged(const Akonadi::Item &item); + +private: + Q_DECLARE_PRIVATE(pEpAgent) + + void initialCollectionFetchingDone(KJob *job); + void initializeCollections(); + + void emitProgress(int p); + void emitProgressMessage(const QString &message); + + void configure(WId windowId); + void clearMessage(); + void emitStatusReady(); + bool isFilterableCollection(const Akonadi::Collection &collection) const; + + QTimer *mProgressTimer; + int mProgressCounter; +}; + +#endif diff --git a/akonadi_pep_agent/pepmessage.h b/akonadi_pep_agent/pepmessage.h new file mode 100644 index 0000000..1299cc2 --- /dev/null +++ b/akonadi_pep_agent/pepmessage.h @@ -0,0 +1,5 @@ +#ifndef PEP_MESSAGE_H +#define PEP_MESSAGE_H +class pEpMessage { +}; +#endif