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)
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:82
Helper class for expanding inter-resource collection moves inside ResourceBase.
Definition: recursivemover_p.h:37
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition: itemfetchscope.cpp:80
void retrieveCollectionAttributes(const Akonadi::Collection &collection)
Retrieve the attributes of a single collection from the backend.
Definition: resourcebase.cpp:1296
void abortActivity()
Abort any activity in progress in the backend.
Definition: resourcebase.cpp:1301
void disableRevisionCheck()
Disables the check of the revision number.
Definition: itemmodifyjob.cpp:451
void setQuitOnLastWindowClosed(bool quit)
void percent(int progress)
This signal should be emitted whenever the progress of an action in the agent (e.g.
virtual void retrieveCollections()=0
Retrieve the collection tree from the remote server and supply it via collectionsRetrieved() or colle...
Collection::List collections() const
Returns the list of fetched collection.
Definition: collectionfetchjob.cpp:169
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
void attributesSynchronized(qlonglong collectionId)
Emitted when a collection attributes synchronization has been completed.
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
bool shouldList(ListPurpose purpose) const
Returns whether the collection should be listed or not for the specified purpose Takes enabled state ...
Definition: collection.cpp:321
void collectionsRetrievalDone()
Call this method to indicate you finished synchronizing the collection tree.
Definition: resourcebase.cpp:840
void setAutomaticProgressReporting(bool enabled)
Enable or disable automatic progress reporting.
Definition: resourcebase.cpp:1326
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 synchronizeCollectionAttributes(qint64 id)
This method is called whenever the collection with the given id shall have its attributes synchronize...
Definition: resourcebase.cpp:1165
Only list direct sub-collections of the base collection.
Definition: collectionfetchjob.h:63
CollectionFetchScope & fetchScope()
Returns the collection fetch scope.
Definition: collectionfetchjob.cpp:439
void setResource(const QString &resource)
Sets a resource filter, that is only collections owned by the specified resource are retrieved...
Definition: collectionfetchscope.cpp:118
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:53
void itemsRetrieved(const Item::List &items)
Call this method to supply the full collection listing from the remote server.
Definition: resourcebase.cpp:1213
void setListFilter(ListFilter)
Sets a filter for the collections to be listed.
Definition: collectionfetchscope.cpp:148
void setDelayedReply(bool enable) const
bool isEmpty() const
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition: collection.cpp:202
void agentNameChanged(const QString &name)
This signal is emitted whenever the name of the agent has changed.
void setItemSynchronizationFetchScope(const ItemFetchScope &fetchScope)
Set the fetch scope applied for item synchronization.
Definition: resourcebase.cpp:1311
void setKeepLocalCollectionChanges(const QSet< QByteArray > &parts)
Allows to keep locally changed collection parts during the collection sync.
Definition: resourcebase.cpp:857
void setItemMergingMode(ItemSync::MergeMode mode)
Set merge mode for item sync'ing.
Definition: resourcebase.cpp:1320
const_iterator insert(const T &value)
QThread * thread() const
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
void nameChanged(const QString &name)
This signal is emitted whenever the name of the resource has changed.
Definition: agentbase_p.h:39
void changesCommitted(const Item::List &items)
Resets the dirty flag of all given items and updates remote ids.
Definition: resourcebase.cpp:710
Only fetch the base collection.
Definition: collectionfetchjob.h:62
Syncs between items known to a client (usually a resource) and the Akonadi storage.
Definition: itemsync.h:54
void itemsRetrievalDone()
Call this method to indicate you finished synchronizing the current collection.
Definition: resourcebase.cpp:1035
void deferTask()
Stops the execution of the current task and continues with the next one.
Definition: resourcebase.cpp:1123
void clear()
void exit(int returnCode)
void setAgentName(const QString &name)
This method is used to set the name of the agent.
Definition: agentbase.cpp:1136
SchedulePriority
Describes the scheduling priority of a task that has been queued for execution.
Definition: resourcebase.h:704
void synchronize()
This method is called whenever the resource should start synchronize all data.
Definition: resourcebase.cpp:532
QString fromLocal8Bit(const char *str, int size)
void error(const QString &message)
This signal shall be used to report errors.
virtual int status() const
This method returns the current status code of the agent.
void clearCache()
Call this method to remove all items and collections of the resource from the server cache...
Definition: resourcebase.cpp:1047
void collectionAttributesRetrieved(const Collection &collection)
Call this method from retrieveCollectionAttributes() once the result is available.
Definition: resourcebase.cpp:635
bool isEmpty() const
bool isEmpty() const
int removeAll(const T &value)
void collectionsRetrieved(const Collection::List &collections)
Call this to supply the full folder tree retrieved from the remote server.
Definition: resourcebase.cpp:789
Item currentItem() const
Returns the item that is currently retrieved.
Definition: resourcebase.cpp:1068
Job that deletes a collection in the Akonadi storage.
Definition: collectiondeletejob.h:63
QCoreApplication * instance()
T & first()
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
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
void collectionTreeSynchronized()
Emitted when a collection tree synchronization has been completed.
void setFetchScope(const CollectionFetchScope &fetchScope)
Sets the collection fetch scope.
Definition: collectionfetchjob.cpp:433
void synchronizeCollection(qint64 id)
This method is called whenever the collection with the given id shall be synchronized.
Definition: resourcebase.cpp:1134
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:69
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval. ...
Definition: itemfetchscope.cpp:132
QVariant fromValue(const T &value)
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
void setItemTransactionMode(ItemSync::TransactionMode mode)
Set transaction mode for item sync'ing.
Definition: resourcebase.cpp:1305
Helper job to invalidate item cache for an entire collection.
Definition: invalidatecachejob_p.h:34
QString identifier() const
Returns the instance identifier of this agent.
Definition: agentbase.cpp:1131
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
QByteArray toLatin1() const
void changeCommitted(const Item &item)
Resets the dirty flag of the given item and updates the remote id.
Definition: resourcebase.cpp:705
Base class for jobs that need to run a sequence of sub-jobs in a transaction.
Definition: transactionsequence.h:69
ChangeRecorder * changeRecorder() const
Returns the Akonadi::ChangeRecorder object used for monitoring.
Definition: agentbase.cpp:1175
void dumpMemoryInfo() const
Dumps memory usage information to stdout.
Definition: resourcebase.cpp:1344
QThread * currentThread()
void setHierarchicalRemoteIdentifiersEnabled(bool enable)
Indicate the use of hierarchical remote identifiers.
Definition: resourcebase.cpp:1278
Definition: collectionsync_p.h:53
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
Job that modifies an existing item in the Akonadi storage.
Definition: itemmodifyjob.h:97
Job that selects a resource context for remote identifier based operations.
Definition: resourceselectjob_p.h:82
void changeProcessed()
Removes the previously emitted change from the records.
Definition: changerecorder.cpp:97
bool isEmpty() const
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
int itemSyncBatchSize() const
Returns the batch size used during the item sync.
Definition: resourcebase.cpp:939
QString fromLatin1(const char *str, int size)
iterator insert(const Key &key, const T &value)
void cancelTask()
Stops the execution of the current task and continues with the next one.
Definition: resourcebase.cpp:1082
void setItemSyncBatchSize(int batchSize)
Set the batch size used during the item sync.
Definition: resourcebase.cpp:945
Collection currentCollection() const
Returns the collection that is currently synchronized.
Definition: resourcebase.cpp:1059
QString resource() const
Returns the identifier of the resource owning the collection.
Definition: collection.cpp:207
void setDisableAutomaticItemDeliveryDone(bool disable)
Disables the automatic completion of the item sync, based on the number of delivered items...
Definition: resourcebase.cpp:1195
const QDBusMessage & message() const
virtual QString errorString() const
Returns the error string, if there has been an error, an empty string otherwise.
Definition: job.cpp:301
void setTransactionMode(TransactionMode mode)
Set the transaction mode to use for this sync.
Definition: itemsync.cpp:528
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
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
static QString addNamespace(const QString &string)
Adds the multi-instance namespace to string if required (with '_' as separator).
Definition: servermanager.cpp:337
void setName(const QString &name)
This method is used to set the name of the resource.
Definition: resourcebase.cpp:537
QString dumpMemoryInfoToString() const
Returns a string with memory usage information.
Definition: resourcebase.cpp:1350
Only retrieve collections for synchronization, taking the local preference and enabled into account...
Definition: collectionfetchscope.h:135
bool isVirtual() const
Returns whether the collection is virtual, for example a search collection.
Definition: collection.cpp:261
QString dumpSchedulerToString() const
Dump the state of the scheduler.
Definition: resourcebase.cpp:1338
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 setCacheOnly(bool cacheOnly)
Sets whether payload data should be requested from remote sources or just from the local cache...
Definition: itemfetchscope.cpp:109
void invalidateCache(const Collection &collection)
Call this method to invalidate all cached content in collection.
Definition: resourcebase.cpp:1053
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.