akonadi
trashjob.cpp
65 //called after parent of the trashed item was fetched (needed to see in which resource the item is in)
81 bool mSetRestoreCollection; //only set restore collection when moved to trash collection (not in place)
83 QHash<Collection, Item::List> mCollectionItems; //list of trashed items sorted according to parent collection
84 QHash<Entity::Id, Collection> mParentCollections; //fetched parent collcetion of items (containing the resource name)
97 if (!q->hasSubjobs() || (q->subjobs().contains(static_cast<KJob *>(q->sender())) && q->subjobs().size() == 1)) {
114 Collection modCol(col.id()); //really only modify attribute (forget old remote ids, etc.), otherwise we have an error because of the move
121 //TODO not sure if it is guaranteed that itemsReceived is always before result (otherwise the result is emitted before the attributes are set)
122 q->connect(itemFetchJob, SIGNAL(itemsReceived(Akonadi::Item::List)), SLOT(setAttribute(Akonadi::Item::List)));
136 //When deleting a collection, we want to restore the deleted collection's items restored to the deleted collection's parent, not the items parent
181 CollectionFetchJob *colFetchJob = new CollectionFetchJob(mCollection, CollectionFetchJob::Recursive, q);
182 q->connect(colFetchJob, SIGNAL(collectionsReceived(Akonadi::Collection::List)), SLOT(setAttribute(Akonadi::Collection::List)));
186void TrashJob::TrashJobPrivate::parentCollectionReceived(const Akonadi::Collection::List &collections)
198 if (!mKeepTrashInCollection && trashCollection.isValid()) { //Only set the restore collection if the item is moved to trash
205 ItemMoveJob *job = new ItemMoveJob(mCollectionItems.value(parentCollection), trashCollection, q);
207 q->connect(job, SIGNAL(result(KJob*)), SLOT(setAttribute(KJob*))); //Wait until the move finished to set the attirbute
234 mCollectionItems[item.parentCollection()].append(item); //Sort by parent col ( = restore collection)
253void TrashJob::TrashJobPrivate::collectionsReceived(const Akonadi::Collection::List &collections)
280 if (!mKeepTrashInCollection && trashCollection.isValid()) { //only set the restore collection if the item is moved to trash
284 mRestoreCollection.setResource(mCollection.resource()); //The parent collection doesn't contain the resource, so we have to set it manually
353 job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent); //so we have access to the resource
356 connect(job, SIGNAL(itemsReceived(Akonadi::Item::List)), this, SLOT(itemsReceived(Akonadi::Item::List)));
359 CollectionFetchJob *job = new CollectionFetchJob(d->mCollection, CollectionFetchJob::Base, this);
361 connect(job, SIGNAL(collectionsReceived(Akonadi::Collection::List)), this, SLOT(collectionsReceived(Akonadi::Collection::List)));
Job that deletes a collection in the Akonadi storage.
Definition collectiondeletejob.h:64
Job that fetches collections from the Akonadi storage.
Definition collectionfetchjob.h:54
CollectionFetchScope & fetchScope()
Returns the collection fetch scope.
Definition collectionfetchjob.cpp:439
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition collectionfetchscope.cpp:138
Job that modifies a collection in the Akonadi storage.
Definition collectionmodifyjob.h:83
Job that moves a collection in the Akonadi storage to a new parent collection.
Definition collectionmovejob.h:51
QString resource() const
Returns the identifier of the resource owning the collection.
Definition collection.cpp:207
An Attribute that marks that an entity was marked as deleted.
Definition entitydeletedattribute.h:50
void setRestoreCollection(const Collection &col)
Sets the collection used to restore items which have been moved to trash using a TrashJob If the Reso...
Definition entitydeletedattribute.cpp:49
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition itemfetchscope.cpp:80
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition itemfetchscope.cpp:132
Job that modifies an existing item in the Akonadi storage.
Definition itemmodifyjob.h:98
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
Job that moves an item into a different collection in the Akonadi storage.
Definition itemmovejob.h:49
Definition job_p.h:32
void deleteIfInTrash(bool enable)
Delete Items which are already in trash, instead of ignoring them.
Definition trashjob.cpp:340
virtual void doStart()
This method must be reimplemented in the concrete jobs.
Definition trashjob.cpp:346
TrashJob(const Item &item, QObject *parent=0)
Creates a new trash job that marks item as trash, and moves it to the configured trash collection.
Definition trashjob.cpp:297
void setTrashCollection(const Collection &trashcollection)
Moves all entities to the give collection.
Definition trashjob.cpp:328
void keepTrashInCollection(bool enable)
Ignore configured Trash collections and keep all items local.
Definition trashjob.cpp:334
AKONADI_EXPORT Collection getTrashCollection(const QString &resource)
Get the trash collection for the given resource.
Definition trashsettings.cpp:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.