Akonadi::AgentInstance Class

class Akonadi::AgentInstance

A representation of an agent instance. More...

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

Public Types

enum Status { Idle, Running, Broken, NotConfigured }

Public Functions

AgentInstance()
AgentInstance(const Akonadi::AgentInstance &other)
~AgentInstance()
void abortCurrentTask() const
QStringList activities() const
bool activitiesEnabled() const
QString identifier() const
bool isOnline() const
bool isValid() const
QString name() const
int progress() const
void reconfigure() const
void restart() const
void setActivities(const QStringList &online)
void setActivitiesEnabled(bool enabled)
void setIsOnline(bool online)
void setName(const QString &name)
Akonadi::AgentInstance::Status status() const
QString statusMessage() const
void synchronize()
void synchronizeCollectionTree()
void synchronizeTags()
(since 26.04) QStringList taskList() const
Akonadi::AgentType type() const

Detailed Description

The agent instance is a representation of a running agent process. It provides information about the instance and a reference to the AgentType of that instance.

All available agent instances can be retrieved from the AgentManager.

 Akonadi::AgentInstance::List instances = Akonadi::AgentManager::self()->instances();
 for( const Akonadi::AgentInstance &instance : instances ) {
   qDebug() << "Name:" << instance.name() << "(" << instance.identifier() << ")";
 }

Note: To find the collections belonging to an AgentInstance, use CollectionFetchJob and supply AgentInstance::identifier() as the parameter to CollectionFetchScope::setResource().

@author Tobias Koenig <tokoe@kde.org>

Member Type Documentation

enum AgentInstance::Status

Describes the status of the agent instance.

Member Function Documentation

AgentInstance::AgentInstance()

Creates a new agent instance object.

AgentInstance::AgentInstance(const Akonadi::AgentInstance &other)

Creates an agent instance from an other agent instance.

[noexcept] AgentInstance::~AgentInstance()

Destroys the agent instance object.

void AgentInstance::abortCurrentTask() const

Tell the agent to abort its current operation.

QStringList AgentInstance::activities() const

Returns a list of activities of the agent instance.

See also setActivities().

bool AgentInstance::activitiesEnabled() const

Returns true if agent instance has activities support enabled.

See also setActivitiesEnabled().

QString AgentInstance::identifier() const

Returns the unique identifier of the agent instance.

Note: Getter function for property identifier.

bool AgentInstance::isOnline() const

Returns whether the agent instance is online currently.

Note: Getter function for property isOnline.

See also setIsOnline().

bool AgentInstance::isValid() const

Returns whether the agent instance object is valid.

Note: Getter function for property isValid.

QString AgentInstance::name() const

Returns the user visible name of the agent instance.

Note: Getter function for property name.

See also setName().

int AgentInstance::progress() const

Returns the progress of the agent instance in percent, or -1 if no progress information are available.

Note: Getter function for property progress.

void AgentInstance::reconfigure() const

Tell the agent that its configuration has been changed remotely via D-Bus

void AgentInstance::restart() const

Restart the agent process.

void AgentInstance::setActivities(const QStringList &online)

Sets list of activities of the agent instance

See also activities().

void AgentInstance::setActivitiesEnabled(bool enabled)

Sets activities support enabled

See also activitiesEnabled().

void AgentInstance::setIsOnline(bool online)

Sets online status of the agent instance.

Note: Setter function for property isOnline.

See also isOnline().

void AgentInstance::setName(const QString &name)

Sets the user visible name of the agent instance.

Note: Setter function for property name.

See also name().

Akonadi::AgentInstance::Status AgentInstance::status() const

Returns the status of the agent instance.

Note: Getter function for property status.

QString AgentInstance::statusMessage() const

Returns a textual presentation of the status of the agent instance.

Note: Getter function for property statusMessage.

void AgentInstance::synchronize()

Triggers the agent instance to start synchronization.

void AgentInstance::synchronizeCollectionTree()

Triggers a synchronization of the collection tree by the given agent instance.

void AgentInstance::synchronizeTags()

Triggers a synchronization of tags by the given agent instance.

[since 26.04] QStringList AgentInstance::taskList() const

Request over D-Bus the current list of tasks to process.

This will be available for resources not the other agent types.

Note: this is meant for tooling or debug purpose, don't rely on it for application code.

This function was introduced in 26.04.

Akonadi::AgentType AgentInstance::type() const

Returns the agent type of this instance.