Akonadi::LinkJob Class

class Akonadi::LinkJob

Job that links items inside the Akonadi storage. More...

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

Public Functions

LinkJob(const Akonadi::Collection &collection, const Item::List &items, QObject *parent = nullptr)
virtual ~LinkJob() override

Detailed Description

This job allows you to create references to a set of items in a virtual collection.

Example:

// Links the given items to the given virtual collection
const Akonadi::Collection virtualCollection = ...
const Akonadi::Item::List items = ...

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

...

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

Author: Volker Krause <vkrause@kde.org>

See also UnlinkJob.

Member Function Documentation

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

Creates the link job.

The job will create references to the given items in the given collection.

collection The collection in which the references should be created. items The items of which the references should be created. parent The parent object.

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

Destroys the link job.