CollectionStatisticsJob Class Reference
from PyKDE4.akonadi import *
Inherits: Akonadi.Job → KCompositeJob → KJob → QObject
Namespace: Akonadi
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(); }
Methods | |
__init__ (self, Akonadi.Collection collection, QObject parent=0) | |
Akonadi.Collection | collection (self) |
doHandleResponse (self, QByteArray tag, QByteArray data) | |
doStart (self) | |
Akonadi.CollectionStatistics | statistics (self) |
Method Documentation
__init__ | ( | self, | ||
Akonadi.Collection | collection, | |||
QObject | parent=0 | |||
) |
Creates a new collection statistics job.
- Parameters:
-
collection The collection to fetch the statistics from. parent The parent object.
Akonadi.Collection collection | ( | self ) |
Returns the corresponding collection, if the job was executed successfully, the collection is already updated.
doHandleResponse | ( | self, | ||
QByteArray | tag, | |||
QByteArray | data | |||
) |
doStart | ( | self ) |
Akonadi.CollectionStatistics statistics | ( | self ) |
Returns the fetched collection statistics.