Akonadi::ItemCopyJob Class

class Akonadi::ItemCopyJob

Job that copies a set of items to a target collection in the Akonadi storage. More...

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

Public Functions

ItemCopyJob(const Akonadi::Item &item, const Akonadi::Collection &target, QObject *parent = nullptr)
ItemCopyJob(const Akonadi::Item::List &items, const Akonadi::Collection &target, QObject *parent = nullptr)
virtual ~ItemCopyJob() override

Detailed Description

The job can be used to copy one or several Item objects to another collection.

Example:

 Akonadi::Item::List items = ...
 Akonadi::Collection collection = ...

 Akonadi::ItemCopyJob *job = new Akonadi::ItemCopyJob( items, collection );
 connect(job, &KJob::result, this, &MyClass::jobFinished);

 ...

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

Author: Volker Krause <vkrause@kde.org>

Member Function Documentation

ItemCopyJob::ItemCopyJob(const Akonadi::Item &item, const Akonadi::Collection &target, QObject *parent = nullptr)

Creates a new item copy job.

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

ItemCopyJob::ItemCopyJob(const Akonadi::Item::List &items, const Akonadi::Collection &target, QObject *parent = nullptr)

Creates a new item copy job.

items A list of items to copy. target The target collection. parent The parent object.

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

Destroys the item copy job.