Akonadi::CollectionCopyJob Class

class Akonadi::CollectionCopyJob

Job that copies a collection into another collection in the Akonadi storage. More...

Header: #include <Akonadi/CollectionCopyJob>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore)
Inherits: Akonadi::Job

Public Functions

CollectionCopyJob(const Akonadi::Collection &source, const Akonadi::Collection &target, QObject *parent = nullptr)
virtual ~CollectionCopyJob() override

Detailed Description

This job copies a single collection into a specified target collection.

Example:

 Akonadi::Collection source = ...
 Akonadi::Collection target = ...

 auto job = new Akonadi::CollectionCopyJob(source, target);
 connect(job, &KJob::result, this, &MyClass::copyFinished);

 ...

 MyClass::copyFinished(KJob *job)
 {
     if (job->error()) {
         qDebug() << "Error occurred";
     } else {
         qDebug() << "Copied successfully";
     }
 }

Author: Volker Krause <vkrause@kde.org>

Member Function Documentation

CollectionCopyJob::CollectionCopyJob(const Akonadi::Collection &source, const Akonadi::Collection &target, QObject *parent = nullptr)

Creates a new collection copy job to copy the given source collection into target.

source The collection to copy. target The target collection. parent The parent object.

[override virtual noexcept] CollectionCopyJob::~CollectionCopyJob()

Destroys the collection copy job.