diff options
Diffstat (limited to 'examples/maildirresource/maildirresource.h')
-rw-r--r-- | examples/maildirresource/maildirresource.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/maildirresource/maildirresource.h b/examples/maildirresource/maildirresource.h index e1eecc1..eec1e97 100644 --- a/examples/maildirresource/maildirresource.h +++ b/examples/maildirresource/maildirresource.h | |||
@@ -39,8 +39,36 @@ public: | |||
39 | static void removeFromDisk(const QByteArray &instanceIdentifier); | 39 | static void removeFromDisk(const QByteArray &instanceIdentifier); |
40 | private: | 40 | private: |
41 | KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE; | 41 | KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE; |
42 | |||
43 | /** | ||
44 | * Tries to find a local id for the remote id, and creates a new local id otherwise. | ||
45 | * | ||
46 | * The new local id is recorded in the local to remote id mapping. | ||
47 | */ | ||
42 | QString resolveRemoteId(const QByteArray &type, const QString &remoteId, Akonadi2::Storage::Transaction &transaction); | 48 | QString resolveRemoteId(const QByteArray &type, const QString &remoteId, Akonadi2::Storage::Transaction &transaction); |
49 | |||
50 | /** | ||
51 | * Tries to find a remote id for a local id. | ||
52 | * | ||
53 | * This can fail if the entity hasn't been written back to the server yet. | ||
54 | */ | ||
43 | QString resolveLocalId(const QByteArray &bufferType, const QByteArray &localId, Akonadi2::Storage::Transaction &transaction); | 55 | QString resolveLocalId(const QByteArray &bufferType, const QByteArray &localId, Akonadi2::Storage::Transaction &transaction); |
56 | |||
57 | /** | ||
58 | * An algorithm to remove entities that are no longer existing. | ||
59 | * | ||
60 | * This algorithm calls @param exists for every entity of type @param type, with its remoteId. For every entity where @param exists returns false, | ||
61 | * an entity delete command is enqueued. | ||
62 | */ | ||
63 | void scanForRemovals(Akonadi2::Storage::Transaction &transaction, Akonadi2::Storage::Transaction &synchronizationTransaction, const QByteArray &bufferType, std::function<bool(const QByteArray &remoteId)> exists); | ||
64 | |||
65 | /** | ||
66 | * An algorithm to create or modify the entity. | ||
67 | * | ||
68 | * Depending on whether the entity is locally available, or has changed. | ||
69 | */ | ||
70 | void createOrModify(Akonadi2::Storage::Transaction &transaction, Akonadi2::Storage::Transaction &synchronizationTransaction, DomainTypeAdaptorFactoryInterface &adaptorFactory, const QByteArray &bufferType, const QByteArray &remoteId, const Akonadi2::ApplicationDomain::ApplicationDomainType &entity); | ||
71 | |||
44 | void synchronizeFolders(Akonadi2::Storage::Transaction &transaction); | 72 | void synchronizeFolders(Akonadi2::Storage::Transaction &transaction); |
45 | void synchronizeMails(Akonadi2::Storage::Transaction &transaction, const QString &folder); | 73 | void synchronizeMails(Akonadi2::Storage::Transaction &transaction, const QString &folder); |
46 | QStringList listAvailableFolders(); | 74 | QStringList listAvailableFolders(); |