CollectionFetchJob Class Reference
from PyKDE4.akonadi import *
Inherits: Akonadi.Job → KCompositeJob → KJob → QObject
Namespace: Akonadi
Detailed Description
Job that fetches collections from the Akonadi storage.
This class can be used to retrieve the complete or partial collection tree from the Akonadi storage.
using namespace Akonadi; // fetching all collections recursive, starting at the root collection CollectionFetchJob *job = new CollectionFetchJob( Collection.root(), CollectionFetchJob.Recursive ); if ( job->exec() ) { Collection.List collections = job->collections(); foreach( const Collection &collection, collections ) { qDebug() << "Name:" << collection.name(); } }
Enumerations | |
Type | { Base, FirstLevel, Recursive } |
Signals | |
collectionsReceived (Akonadi.Collection.List collections) | |
Methods | |
__init__ (self, Akonadi.Collection collection, Akonadi.CollectionFetchJob.Type type=Akonadi.CollectionFetchJob.FirstLevel, QObject parent=0) | |
__init__ (self, Akonadi.Collection.List collections, QObject parent=0) | |
Akonadi.Collection.List | collections (self) |
collectionsReceived (self, Akonadi.Collection.List collections) | |
doHandleResponse (self, QByteArray tag, QByteArray data) | |
doStart (self) | |
includeStatistics (self, bool include=1) | |
includeUnsubscribed (self, bool include=1) | |
setResource (self, QString resource) | |
slotResult (self, KJob job) |
Method Documentation
__init__ | ( | self, | ||
Akonadi.Collection | collection, | |||
Akonadi.CollectionFetchJob.Type | type=Akonadi.CollectionFetchJob.FirstLevel, | |||
QObject | parent=0 | |||
) |
Creates a new collection fetch job. If the given base collection has a unique identifier, this is used to identify the collection in the Akonadi server. If only a remote identifier is avaiable the collection is identified using that, given a resource search context has been specified. There two ways of doing that: by calling setResource() or globally using Akonadi.ResourceSelectJob.
- Parameters:
-
collection The base collection for the listing. type The type of fetch depth. parent The parent object.
__init__ | ( | self, | ||
Akonadi.Collection.List | collections, | |||
QObject | parent=0 | |||
) |
Creates a new collection fetch job to retrieve a list of collections. The same rules for identifiers apply as noted in the constructor above.
- Parameters:
-
collections A list of collections to fetch. Must not be empty. parent The parent object.
Akonadi.Collection.List collections | ( | self ) |
Returns the list of fetched collection.
collectionsReceived | ( | self, | ||
Akonadi.Collection.List | collections | |||
) |
This signal is emitted whenever the job has received collections.
- Parameters:
-
collections The received collections.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionsReceived(const List&)"), target_slot)
doHandleResponse | ( | self, | ||
QByteArray | tag, | |||
QByteArray | data | |||
) |
doStart | ( | self ) |
includeStatistics | ( | self, | ||
bool | include=1 | |||
) |
Include also statistics about the collections.
- Since:
- 4.3
includeUnsubscribed | ( | self, | ||
bool | include=1 | |||
) |
Include also unsubscribed collections.
setResource | ( | self, | ||
QString | resource | |||
) |
Sets a resource identifier to limit collection listing to one resource.
- Parameters:
-
resource The resource identifier.
slotResult | ( | self, | ||
KJob | job | |||
) |
Enumeration Documentation
Type |
Describes the type of fetch depth.
- Enumerator:
-
Base FirstLevel Recursive