Akonadi::ContactGroupExpandJob Class

Job that expands a ContactGroup to a list of contacts. More...

Header: #include <Akonadi/ContactGroupExpandJob>
CMake: find_package(KPim6AkonadiContactCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiContactCore)

Public Functions

ContactGroupExpandJob(const KContacts::ContactGroup &group, QObject *parent = nullptr)
ContactGroupExpandJob(const QString &name, QObject *parent = nullptr)
virtual ~ContactGroupExpandJob() override
KContacts::Addressee::List contacts() const

Reimplemented Public Functions

virtual void start() override

Detailed Description

This job takes a KContacts::ContactGroup object or a name of a contact group and expands it to a list of KContacts::Addressee objects by creating temporary KContacts::Addressee objects for the KContacts::ContactGroup::Data objects of the group and fetching the complete contacts from the Akonadi storage for the KContacts::ContactGroup::ContactReferences of the group.

const KContacts::ContactGroup group = ...;

Akonadi::ContactGroupExpandJob *job = new Akonadi::ContactGroupExpandJob( group );
connect( job, SIGNAL(result(KJob*)), this, SLOT(expandResult(KJob*)) );
job->start();

...

MyClass::expandResult( KJob *job )
{
  Akonadi::ContactGroupExpandJob *expandJob = qobject_cast<Akonadi::ContactGroupExpandJob*>( job );
  const KContacts::Addressee::List contacts = expandJob->contacts();
  // do something with the contacts
}

Author: Tobias Koenig <tokoe@kde.org>

Member Function Documentation

[explicit] ContactGroupExpandJob::ContactGroupExpandJob(const KContacts::ContactGroup &group, QObject *parent = nullptr)

Creates a new contact group expand job.

group The contact group to expand. parent The parent object.

[explicit] ContactGroupExpandJob::ContactGroupExpandJob(const QString &name, QObject *parent = nullptr)

Creates a new contact group expand job.

name The name of the contact group to expand. parent The parent object.

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

Destroys the contact group expand job.

KContacts::Addressee::List ContactGroupExpandJob::contacts() const

Returns the list of contacts.

[override virtual] void ContactGroupExpandJob::start()

Starts the expand job.