Browse Source

Staging

master
David Lanzendörfer 10 months ago
parent
commit
180bf92e84
4 changed files with 70 additions and 10 deletions
  1. +1
    -2
      akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml
  2. +2
    -8
      akonadi_pep_agent/pepagent.cpp
  3. +62
    -0
      akonadi_pep_agent/pepagent.h
  4. +5
    -0
      akonadi_pep_agent/pepmessage.h

+ 1
- 2
akonadi_pep_agent/org.freedesktop.Akonadi.pEpAgent.xml View File

@ -1,12 +1,11 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.Akonadi.Agent.pEpAgent">
<method name="resetIdentity"/>
<method name="decryptMessage" >
<arg direction="in" type="(iiii)" name="message" />
<arg direction="out" type="(iiii)" name="message" />
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="const KMime::Message::Ptr &amp;"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QpEpMessage"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="pEpMessage"/>
</method>
</interface>
</node>

+ 2
- 8
akonadi_pep_agent/pepagent.cpp View File

@ -9,8 +9,6 @@
#include "pepagent_debug.h"
#include "pepagentadaptor.h"
#include "qpepmessage.h" // A hack to ram this shit throug QDbus
#include <Akonadi/KMime/Pop3ResourceAttribute>
#include <AkonadiCore/ServerManager>
#include <AkonadiCore/CollectionFetchJob>
@ -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)


+ 62
- 0
akonadi_pep_agent/pepagent.h View File

@ -0,0 +1,62 @@
#ifndef PEP_RESOURCE_H
#define PEP_RESOURCE_H
#include <ResourceBase>
#include <KMime/Message>
#include <KJob>
#include <QSet>
#include <AkonadiCore/AgentInstance>
#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

+ 5
- 0
akonadi_pep_agent/pepmessage.h View File

@ -0,0 +1,5 @@
#ifndef PEP_MESSAGE_H
#define PEP_MESSAGE_H
class pEpMessage {
};
#endif

Loading…
Cancel
Save