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
Job that deletes a collection in the Akonadi storage.
Definition collectiondeletejob.h:47
Job that fetches collections from the Akonadi storage.
Definition collectionfetchjob.h:39
void collectionsReceived(const Akonadi::Collection::List &collections)
This signal is emitted whenever the job has received collections.
Job that modifies a collection in the Akonadi storage.
Definition collectionmodifyjob.h:62
Job that moves a collection in the Akonadi storage to a new parent collection.
Definition collectionmovejob.h:36
bool hasAttribute(const QByteArray &name) const
Returns true if the collection has an attribute of the given type name, false otherwise.
Definition collection.cpp:161
void setResource(const QString &identifier)
Sets the identifier of the resource owning the collection.
Definition collection.cpp:307
Collection parentCollection() const
Returns the parent collection of this object.
Definition collection.cpp:195
An Attribute that marks that an entity was marked as deleted.
Definition entitydeletedattribute.h:35
void itemsReceived(const Akonadi::Item::List &items)
This signal is emitted whenever new items have been fetched completely.
Job that modifies an existing item in the Akonadi storage.
Definition itemmodifyjob.h:82
Job that moves an item into a different collection in the Akonadi storage.
Definition itemmovejob.h:35
void deleteIfInTrash(bool enable)
Delete Items which are already in trash, instead of ignoring them.
Definition trashjob.cpp:345
void doStart() override
This method must be reimplemented in the concrete jobs.
Definition trashjob.cpp:351
void setTrashCollection(const Collection &trashcollection)
Moves all entities to the give collection.
Definition trashjob.cpp:333
void keepTrashInCollection(bool enable)
Ignore configured Trash collections and keep all items local.
Definition trashjob.cpp:339
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 setErrorText(const QString &errorText)
virtual QString errorString() const
void emitResult()
int error() const
void result(KJob *job)
void setError(int errorCode)
QString i18n(const char *text, const TYPE &arg...)
AKONADICORE_EXPORT Collection getTrashCollection(const QString &resource)
Get the trash collection for the given resource.
Definition trashsettings.cpp:18
Helper integration between Akonadi and Qt.
KIOCORE_EXPORT QStringList list(const QString &fileClass)
void append(QList< T > &&value)
T & first()
bool isEmpty() const const
qsizetype size() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
objectName
QVariant property(const char *name) const const
bool setProperty(const char *name, QVariant &&value)
bool isEmpty() const const
bool isValid() const const
int toInt(bool *ok) const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.