akonadi
Akonadi::CollectionStatisticsJob Class Reference
Job that fetches collection statistics from the Akonadi storage. More...
#include <collectionstatisticsjob.h>

Public Member Functions | |
CollectionStatisticsJob (const Collection &collection, QObject *parent=0) | |
virtual | ~CollectionStatisticsJob () |
Collection | collection () const |
CollectionStatistics | statistics () const |
Protected Member Functions | |
virtual void | doHandleResponse (const QByteArray &tag, const QByteArray &data) |
virtual void | doStart () |
Detailed Description
Job that fetches collection statistics from the Akonadi storage.
This class fetches the CollectionStatistics object for a given collection.
Example:
Akonadi::Collection collection = ... Akonadi::CollectionStatisticsJob *job = new Akonadi::CollectionStatisticsJob( collection ); connect( job, SIGNAL( result( KJob* ) ), SLOT( jobFinished( KJob* ) ) ); ... MyClass::jobFinished( KJob *job ) { if ( job->error() ) { qDebug() << "Error occurred"; return; } CollectionStatisticsJob *statisticsJob = qobject_cast<CollectionStatisticsJob*>( job ); const Akonadi::CollectionStatistics statistics = statisticsJob->statistics(); qDebug() << "Unread items:" << statistics.unreadCount(); }
Definition at line 66 of file collectionstatisticsjob.h.
Constructor & Destructor Documentation
CollectionStatisticsJob::CollectionStatisticsJob | ( | const Collection & | collection, |
QObject * | parent = 0 |
||
) | [explicit] |
Creates a new collection statistics job.
- Parameters:
-
collection The collection to fetch the statistics from. parent The parent object.
Definition at line 43 of file collectionstatisticsjob.cpp.
CollectionStatisticsJob::~CollectionStatisticsJob | ( | ) | [virtual] |
Destroys the collection statistics job.
Definition at line 51 of file collectionstatisticsjob.cpp.
Member Function Documentation
Collection Akonadi::CollectionStatisticsJob::collection | ( | ) | const |
Returns the corresponding collection, if the job was executed successfully, the collection is already updated.
virtual void Akonadi::CollectionStatisticsJob::doHandleResponse | ( | const QByteArray & | tag, |
const QByteArray & | data | ||
) | [protected, virtual] |
This method should be reimplemented in the concrete jobs in case you want to handle incoming data.
It will be called on received data from the backend. The default implementation does nothing.
- Parameters:
-
tag The tag of the corresponding command, empty if this is an untagged response. data The received data.
Reimplemented from Akonadi::Job.
virtual void Akonadi::CollectionStatisticsJob::doStart | ( | ) | [protected, virtual] |
This method must be reimplemented in the concrete jobs.
It will be called after the job has been started and a connection to the Akonadi backend has been established.
Implements Akonadi::Job.
CollectionStatistics Akonadi::CollectionStatisticsJob::statistics | ( | ) | const |
Returns the fetched collection statistics.
Definition at line 210 of file collection.cpp.
The documentation for this class was generated from the following files: