diff options
-rw-r--r-- | common/bufferutils.h | 23 | ||||
-rw-r--r-- | common/commands/modifyentity.fbs | 1 | ||||
-rw-r--r-- | common/domainadaptor.h | 3 | ||||
-rw-r--r-- | common/facade.cpp | 2 | ||||
-rw-r--r-- | common/metadata.fbs | 1 | ||||
-rw-r--r-- | common/pipeline.cpp | 23 | ||||
-rw-r--r-- | common/resourceaccess.cpp | 8 | ||||
-rw-r--r-- | common/resourceaccess.h | 4 | ||||
-rw-r--r-- | common/sourcewriteback.cpp | 16 | ||||
-rw-r--r-- | common/sourcewriteback.h | 4 | ||||
-rw-r--r-- | examples/imapresource/imapresource.cpp | 12 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 4 | ||||
-rw-r--r-- | tests/mailtest.cpp | 2 |
13 files changed, 69 insertions, 34 deletions
diff --git a/common/bufferutils.h b/common/bufferutils.h index 1eb5d15..d6008c4 100644 --- a/common/bufferutils.h +++ b/common/bufferutils.h | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <flatbuffers/flatbuffers.h> | 3 | #include <flatbuffers/flatbuffers.h> |
4 | #include <QByteArray> | 4 | #include <QByteArray> |
5 | #include <QList> | ||
5 | 6 | ||
6 | namespace Sink { | 7 | namespace Sink { |
7 | namespace BufferUtils { | 8 | namespace BufferUtils { |
@@ -21,5 +22,27 @@ static QByteArray extractBuffer(const flatbuffers::FlatBufferBuilder &fbb) | |||
21 | { | 22 | { |
22 | return QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize()); | 23 | return QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize()); |
23 | } | 24 | } |
25 | |||
26 | static QList<QByteArray> fromVector(const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> &vector) | ||
27 | { | ||
28 | QList<QByteArray> list; | ||
29 | for (const auto &data : vector) { | ||
30 | Q_ASSERT(data); | ||
31 | list << QByteArray::fromStdString(data->str()); | ||
32 | } | ||
33 | return list; | ||
34 | } | ||
35 | |||
36 | template <typename T> | ||
37 | static flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> toVector(flatbuffers::FlatBufferBuilder &fbb, const T &list) | ||
38 | { | ||
39 | std::vector<flatbuffers::Offset<flatbuffers::String>> modifiedPropertiesList; | ||
40 | for (const auto &change : list) { | ||
41 | auto s = fbb.CreateString(change); | ||
42 | modifiedPropertiesList.push_back(s); | ||
43 | } | ||
44 | return fbb.CreateVector(modifiedPropertiesList); | ||
45 | } | ||
46 | |||
24 | } | 47 | } |
25 | } | 48 | } |
diff --git a/common/commands/modifyentity.fbs b/common/commands/modifyentity.fbs index efa2fa0..da6f0e2 100644 --- a/common/commands/modifyentity.fbs +++ b/common/commands/modifyentity.fbs | |||
@@ -7,6 +7,7 @@ table ModifyEntity { | |||
7 | domainType: string; | 7 | domainType: string; |
8 | delta: [ubyte]; //Contains an entity buffer with all changed properties set | 8 | delta: [ubyte]; //Contains an entity buffer with all changed properties set |
9 | replayToSource: bool = true; | 9 | replayToSource: bool = true; |
10 | modifiedProperties: [string]; | ||
10 | } | 11 | } |
11 | 12 | ||
12 | root_type ModifyEntity; | 13 | root_type ModifyEntity; |
diff --git a/common/domainadaptor.h b/common/domainadaptor.h index c620f91..3af0fad 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h | |||
@@ -111,6 +111,9 @@ public: | |||
111 | return QVariant(); | 111 | return QVariant(); |
112 | } | 112 | } |
113 | 113 | ||
114 | /** | ||
115 | * Returns all available properties for which a mapping exists (no matter what the buffer contains) | ||
116 | */ | ||
114 | virtual QList<QByteArray> availableProperties() const | 117 | virtual QList<QByteArray> availableProperties() const |
115 | { | 118 | { |
116 | return mResourceMapper->availableProperties() + mLocalMapper->availableProperties(); | 119 | return mResourceMapper->availableProperties() + mLocalMapper->availableProperties(); |
diff --git a/common/facade.cpp b/common/facade.cpp index 1045dac..bebb682 100644 --- a/common/facade.cpp +++ b/common/facade.cpp | |||
@@ -76,7 +76,7 @@ KAsync::Job<void> GenericFacade<DomainType>::modify(const DomainType &domainObje | |||
76 | } | 76 | } |
77 | flatbuffers::FlatBufferBuilder entityFbb; | 77 | flatbuffers::FlatBufferBuilder entityFbb; |
78 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); | 78 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); |
79 | return mResourceAccess->sendModifyCommand(domainObject.identifier(), domainObject.revision(), bufferTypeForDomainType(), QByteArrayList(), BufferUtils::extractBuffer(entityFbb)); | 79 | return mResourceAccess->sendModifyCommand(domainObject.identifier(), domainObject.revision(), bufferTypeForDomainType(), QByteArrayList(), BufferUtils::extractBuffer(entityFbb), domainObject.changedProperties()); |
80 | } | 80 | } |
81 | 81 | ||
82 | template <class DomainType> | 82 | template <class DomainType> |
diff --git a/common/metadata.fbs b/common/metadata.fbs index f2f336d..421d13b 100644 --- a/common/metadata.fbs +++ b/common/metadata.fbs | |||
@@ -6,6 +6,7 @@ table Metadata { | |||
6 | revision: ulong; | 6 | revision: ulong; |
7 | replayToSource: bool = true; | 7 | replayToSource: bool = true; |
8 | operation: Operation = Modification; | 8 | operation: Operation = Modification; |
9 | modifiedProperties: [string]; | ||
9 | } | 10 | } |
10 | 11 | ||
11 | root_type Metadata; | 12 | root_type Metadata; |
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 7863f67..a7059c1 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -228,7 +228,8 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
228 | } | 228 | } |
229 | auto modifyEntity = Commands::GetModifyEntity(command); | 229 | auto modifyEntity = Commands::GetModifyEntity(command); |
230 | Q_ASSERT(modifyEntity); | 230 | Q_ASSERT(modifyEntity); |
231 | 231 | Q_ASSERT(modifyEntity->modifiedProperties()); | |
232 | auto changeset = BufferUtils::fromVector(*modifyEntity->modifiedProperties()); | ||
232 | const qint64 baseRevision = modifyEntity->revision(); | 233 | const qint64 baseRevision = modifyEntity->revision(); |
233 | const bool replayToSource = modifyEntity->replayToSource(); | 234 | const bool replayToSource = modifyEntity->replayToSource(); |
234 | // TODO rename modifyEntity->domainType to bufferType | 235 | // TODO rename modifyEntity->domainType to bufferType |
@@ -281,9 +282,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
281 | // Apply diff | 282 | // Apply diff |
282 | // FIXME only apply the properties that are available in the buffer | 283 | // FIXME only apply the properties that are available in the buffer |
283 | Trace() << "Applying changed properties: " << diff->availableProperties(); | 284 | Trace() << "Applying changed properties: " << diff->availableProperties(); |
284 | QSet<QByteArray> changeset; | 285 | for (const auto &property : changeset) { |
285 | for (const auto &property : diff->availableProperties()) { | ||
286 | changeset << property; | ||
287 | const auto value = diff->getProperty(property); | 286 | const auto value = diff->getProperty(property); |
288 | if (value.isValid()) { | 287 | if (value.isValid()) { |
289 | newAdaptor->setProperty(property, value); | 288 | newAdaptor->setProperty(property, value); |
@@ -303,12 +302,16 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
303 | 302 | ||
304 | // Add metadata buffer | 303 | // Add metadata buffer |
305 | flatbuffers::FlatBufferBuilder metadataFbb; | 304 | flatbuffers::FlatBufferBuilder metadataFbb; |
306 | auto metadataBuilder = MetadataBuilder(metadataFbb); | 305 | { |
307 | metadataBuilder.add_revision(newRevision); | 306 | auto modifiedProperties = BufferUtils::toVector(metadataFbb, changeset); |
308 | metadataBuilder.add_operation(Operation_Modification); | 307 | auto metadataBuilder = MetadataBuilder(metadataFbb); |
309 | metadataBuilder.add_replayToSource(replayToSource); | 308 | metadataBuilder.add_revision(newRevision); |
310 | auto metadataBuffer = metadataBuilder.Finish(); | 309 | metadataBuilder.add_operation(Operation_Modification); |
311 | FinishMetadataBuffer(metadataFbb, metadataBuffer); | 310 | metadataBuilder.add_replayToSource(replayToSource); |
311 | metadataBuilder.add_modifiedProperties(modifiedProperties); | ||
312 | auto metadataBuffer = metadataBuilder.Finish(); | ||
313 | FinishMetadataBuffer(metadataFbb, metadataBuffer); | ||
314 | } | ||
312 | 315 | ||
313 | flatbuffers::FlatBufferBuilder fbb; | 316 | flatbuffers::FlatBufferBuilder fbb; |
314 | adaptorFactory->createBuffer(newAdaptor, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); | 317 | adaptorFactory->createBuffer(newAdaptor, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); |
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 3696a93..5ad2018 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -316,16 +316,16 @@ KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &uid, const | |||
316 | } | 316 | } |
317 | 317 | ||
318 | KAsync::Job<void> | 318 | KAsync::Job<void> |
319 | ResourceAccess::sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer) | 319 | ResourceAccess::sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer, const QByteArrayList &changedProperties) |
320 | { | 320 | { |
321 | flatbuffers::FlatBufferBuilder fbb; | 321 | flatbuffers::FlatBufferBuilder fbb; |
322 | auto entityId = fbb.CreateString(uid.constData()); | 322 | auto entityId = fbb.CreateString(uid.constData()); |
323 | // This is the resource buffer type and not the domain type | 323 | // This is the resource buffer type and not the domain type |
324 | auto type = fbb.CreateString(resourceBufferType.constData()); | 324 | auto type = fbb.CreateString(resourceBufferType.constData()); |
325 | // FIXME | 325 | auto modifiedProperties = BufferUtils::toVector(fbb, changedProperties); |
326 | auto deletions = 0; | 326 | auto deletions = BufferUtils::toVector(fbb, deletedProperties); |
327 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); | 327 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); |
328 | auto location = Sink::Commands::CreateModifyEntity(fbb, revision, entityId, deletions, type, delta); | 328 | auto location = Sink::Commands::CreateModifyEntity(fbb, revision, entityId, deletions, type, delta, true, modifiedProperties); |
329 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); | 329 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); |
330 | open(); | 330 | open(); |
331 | return sendCommand(Sink::Commands::ModifyEntityCommand, fbb); | 331 | return sendCommand(Sink::Commands::ModifyEntityCommand, fbb); |
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index 82aa4d3..69d52b4 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -54,7 +54,7 @@ public: | |||
54 | { | 54 | { |
55 | return KAsync::null<void>(); | 55 | return KAsync::null<void>(); |
56 | }; | 56 | }; |
57 | virtual KAsync::Job<void> sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer) | 57 | virtual KAsync::Job<void> sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer, const QByteArrayList &changedProperties) |
58 | { | 58 | { |
59 | return KAsync::null<void>(); | 59 | return KAsync::null<void>(); |
60 | }; | 60 | }; |
@@ -99,7 +99,7 @@ public: | |||
99 | KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE; | 99 | KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE; |
100 | KAsync::Job<void> sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) Q_DECL_OVERRIDE; | 100 | KAsync::Job<void> sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) Q_DECL_OVERRIDE; |
101 | KAsync::Job<void> | 101 | KAsync::Job<void> |
102 | sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer) Q_DECL_OVERRIDE; | 102 | sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer, const QByteArrayList &changedProperties) Q_DECL_OVERRIDE; |
103 | KAsync::Job<void> sendDeleteCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType) Q_DECL_OVERRIDE; | 103 | KAsync::Job<void> sendDeleteCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType) Q_DECL_OVERRIDE; |
104 | KAsync::Job<void> sendRevisionReplayedCommand(qint64 revision) Q_DECL_OVERRIDE; | 104 | KAsync::Job<void> sendRevisionReplayedCommand(qint64 revision) Q_DECL_OVERRIDE; |
105 | KAsync::Job<void> | 105 | KAsync::Job<void> |
diff --git a/common/sourcewriteback.cpp b/common/sourcewriteback.cpp index 87f6934..a277606 100644 --- a/common/sourcewriteback.cpp +++ b/common/sourcewriteback.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include "definitions.h" | 22 | #include "definitions.h" |
23 | #include "log.h" | 23 | #include "log.h" |
24 | #include "bufferutils.h" | ||
24 | 25 | ||
25 | #define ENTITY_TYPE_MAIL "mail" | 26 | #define ENTITY_TYPE_MAIL "mail" |
26 | #define ENTITY_TYPE_FOLDER "folder" | 27 | #define ENTITY_TYPE_FOLDER "folder" |
@@ -74,20 +75,25 @@ KAsync::Job<void> SourceWriteBack::replay(const QByteArray &type, const QByteArr | |||
74 | // const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; | 75 | // const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; |
75 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Sink::Operation_Creation; | 76 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Sink::Operation_Creation; |
76 | const auto uid = Sink::Storage::uidFromKey(key); | 77 | const auto uid = Sink::Storage::uidFromKey(key); |
78 | const auto modifiedProperties = metadataBuffer->modifiedProperties() ? BufferUtils::fromVector(*metadataBuffer->modifiedProperties()) : QByteArrayList(); | ||
77 | QByteArray oldRemoteId; | 79 | QByteArray oldRemoteId; |
78 | 80 | ||
79 | if (operation != Sink::Operation_Creation) { | 81 | if (operation != Sink::Operation_Creation) { |
80 | oldRemoteId = syncStore().resolveLocalId(type, uid); | 82 | oldRemoteId = syncStore().resolveLocalId(type, uid); |
83 | if (oldRemoteId.isEmpty()) { | ||
84 | Warning() << "Couldn't find the remote id for: " << type << uid; | ||
85 | return KAsync::error<void>(1, "Couldn't find the remote id."); | ||
86 | } | ||
81 | } | 87 | } |
82 | Trace() << "Replaying " << key << type << oldRemoteId; | 88 | Trace() << "Replaying " << key << type << uid << oldRemoteId; |
83 | 89 | ||
84 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); | 90 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); |
85 | if (type == ENTITY_TYPE_FOLDER) { | 91 | if (type == ENTITY_TYPE_FOLDER) { |
86 | auto folder = store().readFromKey<ApplicationDomain::Folder>(key); | 92 | auto folder = store().readFromKey<ApplicationDomain::Folder>(key); |
87 | job = replay(folder, operation, oldRemoteId); | 93 | job = replay(folder, operation, oldRemoteId, modifiedProperties); |
88 | } else if (type == ENTITY_TYPE_MAIL) { | 94 | } else if (type == ENTITY_TYPE_MAIL) { |
89 | auto mail = store().readFromKey<ApplicationDomain::Mail>(key); | 95 | auto mail = store().readFromKey<ApplicationDomain::Mail>(key); |
90 | job = replay(mail, operation, oldRemoteId); | 96 | job = replay(mail, operation, oldRemoteId, modifiedProperties); |
91 | } | 97 | } |
92 | 98 | ||
93 | return job.then<void, QByteArray>([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) { | 99 | return job.then<void, QByteArray>([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) { |
@@ -125,12 +131,12 @@ KAsync::Job<void> SourceWriteBack::replay(const QByteArray &type, const QByteArr | |||
125 | }); | 131 | }); |
126 | } | 132 | } |
127 | 133 | ||
128 | KAsync::Job<QByteArray> SourceWriteBack::replay(const ApplicationDomain::Mail &, Sink::Operation, const QByteArray &) | 134 | KAsync::Job<QByteArray> SourceWriteBack::replay(const ApplicationDomain::Mail &, Sink::Operation, const QByteArray &, const QList<QByteArray> &) |
129 | { | 135 | { |
130 | return KAsync::null<QByteArray>(); | 136 | return KAsync::null<QByteArray>(); |
131 | } | 137 | } |
132 | 138 | ||
133 | KAsync::Job<QByteArray> SourceWriteBack::replay(const ApplicationDomain::Folder &, Sink::Operation, const QByteArray &) | 139 | KAsync::Job<QByteArray> SourceWriteBack::replay(const ApplicationDomain::Folder &, Sink::Operation, const QByteArray &, const QList<QByteArray> &) |
134 | { | 140 | { |
135 | return KAsync::null<QByteArray>(); | 141 | return KAsync::null<QByteArray>(); |
136 | } | 142 | } |
diff --git a/common/sourcewriteback.h b/common/sourcewriteback.h index 9fe5c66..8531ff5 100644 --- a/common/sourcewriteback.h +++ b/common/sourcewriteback.h | |||
@@ -42,8 +42,8 @@ protected: | |||
42 | 42 | ||
43 | protected: | 43 | protected: |
44 | ///Implement to write back changes to the server | 44 | ///Implement to write back changes to the server |
45 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Mail &, Sink::Operation, const QByteArray &oldRemoteId); | 45 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Mail &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); |
46 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Folder &, Sink::Operation, const QByteArray &oldRemoteId); | 46 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Folder &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); |
47 | 47 | ||
48 | //Read/Write access to sync storage | 48 | //Read/Write access to sync storage |
49 | RemoteIdMap &syncStore(); | 49 | RemoteIdMap &syncStore(); |
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 02713b3..b8129cd 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -328,7 +328,7 @@ public: | |||
328 | 328 | ||
329 | } | 329 | } |
330 | 330 | ||
331 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId) | 331 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
332 | { | 332 | { |
333 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 333 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
334 | auto login = imap->login(mUser, mPassword); | 334 | auto login = imap->login(mUser, mPassword); |
@@ -372,10 +372,8 @@ public: | |||
372 | auto uid = ridParts.takeLast().toLongLong(); | 372 | auto uid = ridParts.takeLast().toLongLong(); |
373 | //FIXME don't hardcode the separator | 373 | //FIXME don't hardcode the separator |
374 | auto mailbox = ridParts.join('.'); | 374 | auto mailbox = ridParts.join('.'); |
375 | Trace() << "Modifying a mail: " << oldRemoteId << " in the mailbox: " << mailbox; | 375 | Trace() << "Modifying a mail: " << oldRemoteId << " in the mailbox: " << mailbox << changedProperties; |
376 | //TODO if the message changed, remove old message and create a new one, | 376 | |
377 | //otherwise only change flags | ||
378 | |||
379 | QByteArrayList flags; | 377 | QByteArrayList flags; |
380 | if (!mail.getUnread()) { | 378 | if (!mail.getUnread()) { |
381 | flags << Imap::Flags::Seen; | 379 | flags << Imap::Flags::Seen; |
@@ -384,7 +382,7 @@ public: | |||
384 | flags << Imap::Flags::Flagged; | 382 | flags << Imap::Flags::Flagged; |
385 | } | 383 | } |
386 | 384 | ||
387 | bool messageChanged = false; | 385 | const bool messageChanged = changedProperties.contains(Sink::ApplicationDomain::Mail::MimeMessage::name); |
388 | if (messageChanged) { | 386 | if (messageChanged) { |
389 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); | 387 | QByteArray content = KMime::LFtoCRLF(mail.getMimeMessage()); |
390 | QDateTime internalDate = mail.getDate(); | 388 | QDateTime internalDate = mail.getDate(); |
@@ -431,7 +429,7 @@ public: | |||
431 | return separator + folder.getName(); | 429 | return separator + folder.getName(); |
432 | } | 430 | } |
433 | 431 | ||
434 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId) | 432 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
435 | { | 433 | { |
436 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); | 434 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort); |
437 | auto login = imap->login(mUser, mPassword); | 435 | auto login = imap->login(mUser, mPassword); |
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index d67eb50..18f8334 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp | |||
@@ -405,7 +405,7 @@ public: | |||
405 | 405 | ||
406 | } | 406 | } |
407 | 407 | ||
408 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId) | 408 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
409 | { | 409 | { |
410 | if (operation == Sink::Operation_Creation) { | 410 | if (operation == Sink::Operation_Creation) { |
411 | const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); | 411 | const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); |
@@ -426,7 +426,7 @@ public: | |||
426 | return KAsync::null<QByteArray>(); | 426 | return KAsync::null<QByteArray>(); |
427 | } | 427 | } |
428 | 428 | ||
429 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId) | 429 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Folder &folder, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
430 | { | 430 | { |
431 | if (operation == Sink::Operation_Creation) { | 431 | if (operation == Sink::Operation_Creation) { |
432 | auto folderName = folder.getName(); | 432 | auto folderName = folder.getName(); |
diff --git a/tests/mailtest.cpp b/tests/mailtest.cpp index 9411f91..9046180 100644 --- a/tests/mailtest.cpp +++ b/tests/mailtest.cpp | |||
@@ -221,7 +221,7 @@ void MailTest::testCreateModifyDeleteMail() | |||
221 | void MailTest::testMarkMailAsRead() | 221 | void MailTest::testMarkMailAsRead() |
222 | { | 222 | { |
223 | auto folder = Folder::create(mResourceInstanceIdentifier); | 223 | auto folder = Folder::create(mResourceInstanceIdentifier); |
224 | folder.setName("folder"); | 224 | folder.setName("anotherfolder"); |
225 | VERIFYEXEC(Store::create(folder)); | 225 | VERIFYEXEC(Store::create(folder)); |
226 | 226 | ||
227 | auto message = KMime::Message::Ptr::create(); | 227 | auto message = KMime::Message::Ptr::create(); |