Akonadi::TrashRestoreJob Class
class Akonadi::TrashRestoreJobJob that restores entities from trash. More...
| Header: | #include <TrashRestoreJob> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore) |
| Inherits: | Akonadi::Job |
Public Functions
| TrashRestoreJob(const Akonadi::Item &item, QObject *parent = nullptr) | |
| Akonadi::Item::List | items() const |
| void | setTargetCollection(const Akonadi::Collection &collection) |
Detailed Description
This job restores the given entities from trash. The EntityDeletedAttribute is removed and the item is restored to the stored restore collection.
If the stored restore collection is not available, the root collection of the original resource is used. If also this is not available, setTargetCollection has to be used to restore the item to a specific collection.
Example:
const Akonadi::Item::List items = ... TrashRestoreJob *job = new TrashRestoreJob( items ); connect(job, &KJob::result, this, &MyClass::restoreResult); \class Akonadi::TrashRestoreJob \inheaderfile Akonadi/TrashRestoreJob \inmodule AkonadiCore
Author: Christian Mollekopf <chrigi_1@fastmail.fm>
Member Function Documentation
[explicit] TrashRestoreJob::TrashRestoreJob(const Akonadi::Item &item, QObject *parent = nullptr)
All items need to be from the same resource
Akonadi::Item::List TrashRestoreJob::items() const
void TrashRestoreJob::setTargetCollection(const Akonadi::Collection &collection)
Sets the target collection, where the item is moved to. If not set the item will be restored in the collection saved in the EntityDeletedAttribute. collection the collection to set as target