diff options
Diffstat (limited to 'examples/mailtransportresource/mailtransportresource.cpp')
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index 3fe551a..0688af6 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp | |||
@@ -23,7 +23,6 @@ | |||
23 | #include "resourceconfig.h" | 23 | #include "resourceconfig.h" |
24 | #include "definitions.h" | 24 | #include "definitions.h" |
25 | #include "domainadaptor.h" | 25 | #include "domainadaptor.h" |
26 | #include "sourcewriteback.h" | ||
27 | #include <QDir> | 26 | #include <QDir> |
28 | #include <QFileInfo> | 27 | #include <QFileInfo> |
29 | #include <QSettings> | 28 | #include <QSettings> |
@@ -45,30 +44,6 @@ SINK_DEBUG_AREA("mailtransportresource") | |||
45 | 44 | ||
46 | using namespace Sink; | 45 | using namespace Sink; |
47 | 46 | ||
48 | //TODO fold into synchronizer | ||
49 | class MailtransportWriteback : public Sink::SourceWriteBack | ||
50 | { | ||
51 | public: | ||
52 | MailtransportWriteback(const Sink::ResourceContext &resourceContext) : Sink::SourceWriteBack(resourceContext) | ||
53 | { | ||
54 | |||
55 | } | ||
56 | |||
57 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE | ||
58 | { | ||
59 | if (operation == Sink::Operation_Creation) { | ||
60 | SinkTrace() << "Dispatching message."; | ||
61 | // return send(mail, mSettings); | ||
62 | } else if (operation == Sink::Operation_Removal) { | ||
63 | } else if (operation == Sink::Operation_Modification) { | ||
64 | } | ||
65 | return KAsync::null<QByteArray>(); | ||
66 | } | ||
67 | |||
68 | public: | ||
69 | MailtransportResource::Settings mSettings; | ||
70 | }; | ||
71 | |||
72 | class MailtransportSynchronizer : public Sink::Synchronizer { | 47 | class MailtransportSynchronizer : public Sink::Synchronizer { |
73 | public: | 48 | public: |
74 | MailtransportSynchronizer(const Sink::ResourceContext &resourceContext) | 49 | MailtransportSynchronizer(const Sink::ResourceContext &resourceContext) |
@@ -134,6 +109,17 @@ public: | |||
134 | }); | 109 | }); |
135 | } | 110 | } |
136 | 111 | ||
112 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE | ||
113 | { | ||
114 | if (operation == Sink::Operation_Creation) { | ||
115 | SinkTrace() << "Dispatching message."; | ||
116 | // return send(mail, mSettings); | ||
117 | } else if (operation == Sink::Operation_Removal) { | ||
118 | } else if (operation == Sink::Operation_Modification) { | ||
119 | } | ||
120 | return KAsync::null<QByteArray>(); | ||
121 | } | ||
122 | |||
137 | public: | 123 | public: |
138 | QByteArray mResourceInstanceIdentifier; | 124 | QByteArray mResourceInstanceIdentifier; |
139 | MailtransportResource::Settings mSettings; | 125 | MailtransportResource::Settings mSettings; |
@@ -154,10 +140,6 @@ MailtransportResource::MailtransportResource(const Sink::ResourceContext &resour | |||
154 | synchronizer->mSettings = mSettings; | 140 | synchronizer->mSettings = mSettings; |
155 | setupSynchronizer(synchronizer); | 141 | setupSynchronizer(synchronizer); |
156 | 142 | ||
157 | auto changereplay = QSharedPointer<MailtransportWriteback>::create(resourceContext); | ||
158 | changereplay->mSettings = mSettings; | ||
159 | setupChangereplay(changereplay); | ||
160 | |||
161 | setupPreprocessors(ENTITY_TYPE_MAIL, QVector<Sink::Preprocessor*>() << new MimeMessageMover << new MailPropertyExtractor); | 143 | setupPreprocessors(ENTITY_TYPE_MAIL, QVector<Sink::Preprocessor*>() << new MimeMessageMover << new MailPropertyExtractor); |
162 | } | 144 | } |
163 | 145 | ||