Akonadi
trashjob.cpp
49 // called after parent of the trashed item was fetched (needed to see in which resource the item is in)
65 bool mSetRestoreCollection = false; // only set restore collection when moved to trash collection (not in place)
67 QHash<Collection, Item::List> mCollectionItems; // list of trashed items sorted according to parent collection
68 QHash<Item::Id, Collection> mParentCollections; // fetched parent collection of items (containing the resource name)
80 if (!q->hasSubjobs() || (q->subjobs().contains(static_cast<KJob *>(q->sender())) && q->subjobs().size() == 1)) {
97 Collection modCol(col.id()); // really only modify attribute (forget old remote ids, etc.), otherwise we have an error because of the move
106 // TODO not sure if it is guaranteed that itemsReceived is always before result (otherwise the result is emitted before the attributes are set)
125 // When deleting a collection, we want to restore the deleted collection's items restored to the deleted collection's parent, not the items parent
193 if (!mKeepTrashInCollection && trashCollection.isValid()) { // Only set the restore collection if the item is moved to trash
232 mCollectionItems[item.parentCollection()].append(item); // Sort by parent col ( = restore collection)
282 if (!mKeepTrashInCollection && trashCollection.isValid()) { // only set the restore collection if the item is moved to trash
286 mRestoreCollection.setResource(mCollection.resource()); // The parent collection doesn't contain the resource, so we have to set it manually
358 job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent); // so we have access to the resource
T & first()
void itemsReceived(const Akonadi::Item::List &items)
This signal is emitted whenever new items have been fetched completely.
bool isValid() const const
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:67
Job that deletes items from the Akonadi storage.
Definition: itemdeletejob.h:47
void deleteIfInTrash(bool enable)
Delete Items which are already in trash, instead of ignoring them.
Definition: trashjob.cpp:345
void setErrorText(const QString &errorText)
void result(KJob *job)
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
TrashJob(const Item &item, QObject *parent=nullptr)
Creates a new trash job that marks item as trash, and moves it to the configured trash collection.
Definition: trashjob.cpp:302
void setTrashCollection(const Collection &trashcollection)
Moves all entities to the give collection.
Definition: trashjob.cpp:333
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:39
Job that moves an item into a different collection in the Akonadi storage.
Definition: itemmovejob.h:34
void collectionsReceived(const Akonadi::Collection::List &collections)
This signal is emitted whenever the job has received collections.
int size() const const
Job that modifies an existing item in the Akonadi storage.
Definition: itemmodifyjob.h:81
QString i18n(const char *text, const TYPE &arg...)
bool isEmpty() const const
Collection parentCollection() const
Returns the parent collection of this object.
Definition: item.cpp:153
int toInt(bool *ok) const const
bool isEmpty() const const
Job that moves a collection in the Akonadi storage to a new parent collection.
Definition: collectionmovejob.h:35
bool setProperty(const char *name, const QVariant &value)
void keepTrashInCollection(bool enable)
Ignore configured Trash collections and keep all items local.
Definition: trashjob.cpp:339
void doStart() override
This method must be reimplemented in the concrete jobs.
Definition: trashjob.cpp:351
AKONADICORE_EXPORT Collection getTrashCollection(const QString &resource)
Get the trash collection for the given resource.
Definition: trashsettings.cpp:18
Job that deletes a collection in the Akonadi storage.
Definition: collectiondeletejob.h:50
bool hasAttribute(const QByteArray &name) const
Returns true if the item has an attribute of the given type name, false otherwise.
Definition: item.cpp:128
An Attribute that marks that an entity was marked as deleted.
Definition: entitydeletedattribute.h:34
objectName
void emitResult()
virtual QString errorString() const
int error() const
void setError(int errorCode)
Q_D(Todo)
QVariant property(const char *name) const const
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:01:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:01:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.