Akonadi::UnlinkJob Class

class Akonadi::UnlinkJob

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

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

Public Functions

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

Detailed Description

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

Example:

 // Unlink the given items from the given collection
 const Akonadi::Collection virtualCollection = ...
 const Akonadi::Item::List items = ...

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

 ...

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

Author: Volker Krause <vkrause@kde.org>

See also LinkJob.

Member Function Documentation

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

Creates a new unlink job.

The job will remove references to the given items from the given collection.

collection The collection from which the references should be removed. items The items of which the references should be removed. parent The parent object.

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

Destroys the unlink job.