akonadi
resourcebase.cpp
91 // HACK: skip local changes of the EntityDisplayAttribute by default. Remove this for KDE5 and adjust resource implementations accordingly.
178 "createItemSyncInstance", "Calling items retrieval methods although no item retrieval is in progress");
191 connect(mItemSyncer, SIGNAL(readyForNextBatch(int)), q, SIGNAL(retrieveNextItemSyncBatch(int)));
202 QMetaObject::invokeMethod(const_cast<ResourceBase *>(q), "dumpResourceToString", Qt::DirectConnection, Q_RETURN_ARG(QString, retVal));
217 // reimplementations from AgentbBasePrivate, containing sanity checks that only apply to resources
219 // TODO: we could possibly add recovery code for no-RID notifications by re-enquing those to the change recorder
220 // as the corresponding Add notifications, although that contains a risk of endless fail/retry loops
262 void itemsTagsChanged(const Item::List &items, const QSet<Tag> &addedTags, const QSet<Tag> &removedTags)
284 void itemMoved(const Akonadi::Item &item, const Akonadi::Collection &source, const Akonadi::Collection &destination)
293 void itemsMoved(const Item::List &items, const Collection &source, const Collection &destination)
366 void collectionChanged(const Akonadi::Collection &collection, const QSet< QByteArray > &partIdentifiers)
375 void collectionMoved(const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination)
383 // inter-resource moves, requires we know which resources the source and destination are in though
384 if (!source.resource().isEmpty() && !destination.resource().isEmpty() && source.resource() != destination.resource()) {
505 connect(d->scheduler, SIGNAL(collectionTreeSyncComplete()), SIGNAL(collectionTreeSynchronized()));
664 CollectionFetchJob *job = new CollectionFetchJob(Collection::root(), CollectionFetchJob::FirstLevel);
763 QString ResourceBase::requestItemDeliveryV2(qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &_parts)
873 CollectionFetchJob *list = new CollectionFetchJob(Collection::root(), CollectionFetchJob::Recursive);
905 // This can happen due to FetchHelper::triggerOnDemandFetch() in the akonadi server (not an error).
913 emit q->status(AgentBase::Running, i18nc("@info:status", "Syncing folder '%1'", currentCollection.displayName()));
916 Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob(col, CollectionFetchJob::Base, this);
954 Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob(col, CollectionFetchJob::Base, this);
956 connect(fetchJob, SIGNAL(result(KJob*)), q, SLOT(slotAttributeRetrievalCollectionFetchDone(KJob*)));
971 QMetaObject::invokeMethod(q, "retrieveCollectionAttributes", Q_ARG(Akonadi::Collection, fetchJob->collections().first()));
978 fetch->fetchScope().setAncestorRetrieval(q->changeRecorder()->itemFetchScope().ancestorRetrieval());
1141 CollectionFetchJob *job = new CollectionFetchJob(Collection(collectionId), recursive ? CollectionFetchJob::Recursive : CollectionFetchJob::Base);
1167 CollectionFetchJob *job = new CollectionFetchJob(Collection(collectionId), CollectionFetchJob::Base);
1284 void ResourceBase::scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument, SchedulePriority priority)
int itemSyncBatchSize() const
Returns the batch size used during the item sync.
Definition: resourcebase.cpp:939
void scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument, SchedulePriority priority=Append)
Schedules a custom task in the internal scheduler.
Definition: resourcebase.cpp:1284
void invalidateCache(const Collection &collection)
Call this method to invalidate all cached content in collection.
Definition: resourcebase.cpp:1053
@ Sync
Only retrieve collections for synchronization, taking the local preference and enabled into account.
Definition: collectionfetchscope.h:135
void retrieveCollectionAttributes(const Akonadi::Collection &collection)
Retrieve the attributes of a single collection from the backend.
Definition: resourcebase.cpp:1296
virtual void retrieveCollections()=0
Retrieve the collection tree from the remote server and supply it via collectionsRetrieved() or colle...
void attributesSynchronized(qlonglong collectionId)
Emitted when a collection attributes synchronization has been completed.
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:83
CollectionFetchScope & fetchScope()
Returns the collection fetch scope.
Definition: collectionfetchjob.cpp:439
void setAutomaticProgressReporting(bool enabled)
Enable or disable automatic progress reporting.
Definition: resourcebase.cpp:1326
Job that selects a resource context for remote identifier based operations.
Definition: resourceselectjob_p.h:83
void collectionsRetrievalDone()
Call this method to indicate you finished synchronizing the collection tree.
Definition: resourcebase.cpp:840
void synchronizeCollectionAttributes(qint64 id)
This method is called whenever the collection with the given id shall have its attributes synchronize...
Definition: resourcebase.cpp:1165
void setCollectionStreamingEnabled(bool enable)
Enable collection streaming, that is collections don't have to be delivered at once as result of a re...
Definition: resourcebase.cpp:824
void setUpdateGid(bool update)
Sets whether the GID shall be updated either from the gid parameter or by extracting it from the payl...
Definition: itemmodifyjob.cpp:435
void setCacheOnly(bool cacheOnly)
Sets whether payload data should be requested from remote sources or just from the local cache.
Definition: itemfetchscope.cpp:109
void itemsRetrieved(const Item::List &items)
Call this method to supply the full collection listing from the remote server.
Definition: resourcebase.cpp:1213
void changeProcessed()
Removes the previously emitted change from the records.
Definition: changerecorder.cpp:97
void dumpMemoryInfo() const
Dumps memory usage information to stdout.
Definition: resourcebase.cpp:1344
void setItemMergingMode(ItemSync::MergeMode mode)
Set merge mode for item sync'ing.
Definition: resourcebase.cpp:1320
void setKeepLocalCollectionChanges(const QSet< QByteArray > &parts)
Allows to keep locally changed collection parts during the collection sync.
Definition: resourcebase.cpp:857
Helper class for expanding inter-resource collection moves inside ResourceBase.
Definition: recursivemover_p.h:38
void nameChanged(const QString &name)
This signal is emitted whenever the name of the resource has changed.
void setItemSynchronizationFetchScope(const ItemFetchScope &fetchScope)
Set the fetch scope applied for item synchronization.
Definition: resourcebase.cpp:1311
void setTotalItems(int amount)
Call this method when you want to use the itemsRetrieved() method in streaming mode and indicate the ...
Definition: resourcebase.cpp:1185
QString resource() const
Returns the identifier of the resource owning the collection.
Definition: collection.cpp:207
void changesCommitted(const Item::List &items)
Resets the dirty flag of all given items and updates remote ids.
Definition: resourcebase.cpp:710
void itemsRetrievalDone()
Call this method to indicate you finished synchronizing the current collection.
Definition: resourcebase.cpp:1035
void agentNameChanged(const QString &name)
This signal is emitted whenever the name of the agent has changed.
static QString agentServiceName(ServiceAgentType agentType, const QString &identifier)
Returns the namespaced D-Bus service name for an agent of type agentType with agent identifier identi...
Definition: servermanager.cpp:323
QString dumpMemoryInfoToString() const
Returns a string with memory usage information.
Definition: resourcebase.cpp:1350
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:54
void synchronize()
This method is called whenever the resource should start synchronize all data.
Definition: resourcebase.cpp:532
void percent(int progress)
This signal should be emitted whenever the progress of an action in the agent (e.g.
Collection::List collections() const
Returns the list of fetched collection.
Definition: collectionfetchjob.cpp:169
virtual int status() const
This method returns the current status code of the agent.
Definition: agentbase_p.h:40
void deferTask()
Stops the execution of the current task and continues with the next one.
Definition: resourcebase.cpp:1123
Job that modifies an existing item in the Akonadi storage.
Definition: itemmodifyjob.h:98
void setListFilter(ListFilter)
Sets a filter for the collections to be listed.
Definition: collectionfetchscope.cpp:148
SchedulePriority
Describes the scheduling priority of a task that has been queued for execution.
Definition: resourcebase.h:704
void clearCache()
Call this method to remove all items and collections of the resource from the server cache.
Definition: resourcebase.cpp:1047
void collectionsRetrieved(const Collection::List &collections)
Call this to supply the full folder tree retrieved from the remote server.
Definition: resourcebase.cpp:789
virtual QString errorString() const
Returns the error string, if there has been an error, an empty string otherwise.
Definition: job.cpp:301
void collectionAttributesRetrieved(const Collection &collection)
Call this method from retrieveCollectionAttributes() once the result is available.
Definition: resourcebase.cpp:635
void setFetchScope(const CollectionFetchScope &fetchScope)
Sets the collection fetch scope.
Definition: collectionfetchjob.cpp:433
static QString addNamespace(const QString &string)
Adds the multi-instance namespace to string if required (with '_' as separator).
Definition: servermanager.cpp:337
QString dumpSchedulerToString() const
Dump the state of the scheduler.
Definition: resourcebase.cpp:1338
void setResource(const QString &resource)
Sets a resource filter, that is only collections owned by the specified resource are retrieved.
Definition: collectionfetchscope.cpp:118
Helper job to invalidate item cache for an entire collection.
Definition: invalidatecachejob_p.h:35
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition: collection.cpp:202
void setAgentName(const QString &name)
This method is used to set the name of the agent.
Definition: agentbase.cpp:1136
void itemsRetrievedIncremental(const Item::List &changedItems, const Item::List &removedItems)
Call this method to supply incrementally retrieved items from the remote server.
Definition: resourcebase.cpp:1222
@ FirstLevel
Only list direct sub-collections of the base collection.
Definition: collectionfetchjob.h:63
Item currentItem() const
Returns the item that is currently retrieved.
Definition: resourcebase.cpp:1068
void setIgnorePayload(bool ignore)
Sets whether the payload of the modified item shall be omitted from transmission to the Akonadi stora...
Definition: itemmodifyjob.cpp:411
void disableRevisionCheck()
Disables the check of the revision number.
Definition: itemmodifyjob.cpp:451
void collectionTreeSynchronized()
Emitted when a collection tree synchronization has been completed.
Syncs between items known to a client (usually a resource) and the Akonadi storage.
Definition: itemsync.h:55
void synchronizeCollection(qint64 id)
This method is called whenever the collection with the given id shall be synchronized.
Definition: resourcebase.cpp:1134
Base class for jobs that need to run a sequence of sub-jobs in a transaction.
Definition: transactionsequence.h:70
void setItemTransactionMode(ItemSync::TransactionMode mode)
Set transaction mode for item sync'ing.
Definition: resourcebase.cpp:1305
void changeCommitted(const Item &item)
Resets the dirty flag of the given item and updates the remote id.
Definition: resourcebase.cpp:705
void error(const QString &message)
This signal shall be used to report errors.
Job that deletes a collection in the Akonadi storage.
Definition: collectiondeletejob.h:64
QString identifier() const
Returns the instance identifier of this agent.
Definition: agentbase.cpp:1131
QStringList contentMimeTypes() const
Returns a list of possible content mimetypes, e.g.
Definition: collection.cpp:115
void setHierarchicalRemoteIdentifiersEnabled(bool enable)
Indicate the use of hierarchical remote identifiers.
Definition: resourcebase.cpp:1278
ChangeRecorder * changeRecorder() const
Returns the Akonadi::ChangeRecorder object used for monitoring.
Definition: agentbase.cpp:1175
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition: itemfetchscope.cpp:132
void itemRetrieved(const Item &item)
Call this method from retrieveItem() once the result is available.
Definition: resourcebase.cpp:599
void setCollection(const Akonadi::Collection &collection, const Akonadi::Collection &parentCollection)
Set the collection that is actually moved.
Definition: recursivemover.cpp:47
void cancelTask()
Stops the execution of the current task and continues with the next one.
Definition: resourcebase.cpp:1082
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition: itemfetchscope.cpp:80
void setItemSyncBatchSize(int batchSize)
Set the batch size used during the item sync.
Definition: resourcebase.cpp:945
static int init(int argc, char **argv)
Use this method in the main function of your resource application to initialize your resource subclas...
Definition: resourcebase.h:180
void abortRequested()
Emitted when another application has remotely asked the agent to abort its current operation.
QString dumpNotificationListToString() const
Dump the contents of the current ChangeReplay.
Definition: resourcebase.cpp:1332
Collection currentCollection() const
Returns the collection that is currently synchronized.
Definition: resourcebase.cpp:1059
bool isVirtual() const
Returns whether the collection is virtual, for example a search collection.
Definition: collection.cpp:261
void setDisableAutomaticItemDeliveryDone(bool disable)
Disables the automatic completion of the item sync, based on the number of delivered items.
Definition: resourcebase.cpp:1195
Definition: collectionsync_p.h:54
void collectionsRetrievedIncremental(const Collection::List &changedCollections, const Collection::List &removedCollections)
Call this to supply incrementally retrieved collections from the remote server.
Definition: resourcebase.cpp:806
void setName(const QString &name)
This method is used to set the name of the resource.
Definition: resourcebase.cpp:537
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by doxygen 1.8.18 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by doxygen 1.8.18 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.