akonadi
specialcollections.cpp
41 SpecialCollectionsPrivate::SpecialCollectionsPrivate( KCoreConfigSkeleton *settings, SpecialCollections *qq )
55 QObject::connect( mMonitor, SIGNAL(collectionStatisticsChanged(Akonadi::Collection::Id,Akonadi::CollectionStatistics)),
117 void SpecialCollectionsPrivate::collectionStatisticsChanged( Akonadi::Collection::Id collectionId, const Akonadi::CollectionStatistics &statistics )
121 Akonadi::CollectionFetchJob* fetchJob = new Akonadi::CollectionFetchJob( Collection( collectionId ), Akonadi::CollectionFetchJob::Base );
131 kWarning() << "Error fetching collection to get name from id for statistics updating in specialcollections!";
135 const Akonadi::CollectionFetchJob *fetchJob = qobject_cast<Akonadi::CollectionFetchJob*>( job );
139 const Akonadi::CollectionStatistics statistics = fetchJob->property( "statistics" ).value<Akonadi::CollectionStatistics>();
141 mFoldersForResource[ collection.resource() ][ collection.name().toUtf8() ].setStatistics( statistics );
194 bool SpecialCollections::hasCollection( const QByteArray &type, const AgentInstance &instance ) const
199 Akonadi::Collection SpecialCollections::collection( const QByteArray &type, const AgentInstance &instance ) const
204 void SpecialCollections::setSpecialCollectionType(const QByteArray &type, const Akonadi::Collection &collection)
206 if (!collection.hasAttribute<SpecialCollectionAttribute>() || collection.attribute<SpecialCollectionAttribute>()->collectionType() != type) {
208 SpecialCollectionAttribute *attribute = attributeCollection.attribute<SpecialCollectionAttribute>(Collection::AddIfMissing);
244 bool SpecialCollections::registerCollection( const QByteArray &type, const Collection &collection )
Job that modifies a collection in the Akonadi storage.
Definition: collectionmodifyjob.h:82
void fetchCollectionStatistics(bool enable)
Enables automatic fetching of changed collection statistics information from the Akonadi storage...
Definition: monitor.cpp:185
bool registerCollection(const QByteArray &type, const Akonadi::Collection &collection)
Registers the given collection as a special collection with the given type.
Definition: specialcollections.cpp:244
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval. ...
Definition: collectionfetchscope.cpp:134
Collection::List collections() const
Returns the list of fetched collection.
Definition: collectionfetchjob.cpp:175
bool hasCollection(const QByteArray &type, const AgentInstance &instance) const
Returns whether the given agent instance has a special collection of the given type.
Definition: specialcollections.cpp:194
void defaultCollectionsChanged()
Emitted when the special collections for the default resource have been changed (for example...
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
bool hasDefaultCollection(const QByteArray &type) const
Returns whether the default resource has a special collection of the given type.
Definition: specialcollections.cpp:272
void setCollectionMonitored(const Collection &collection, bool monitored=true)
Sets whether the specified collection shall be monitored for changes.
Definition: monitor.cpp:66
void beginBatchRegister()
Avoids emitting the foldersChanged() signal until endBatchRegister() is called.
Definition: specialcollections.cpp:144
CollectionFetchScope & fetchScope()
Returns the collection fetch scope.
Definition: collectionfetchjob.cpp:437
Job that fetches collections from the Akonadi storage.
Definition: collectionfetchjob.h:53
An Attribute that stores the special collection type of a collection.
Definition: specialcollectionattribute_p.h:39
QString identifier() const
Returns the unique identifier of the agent instance.
Definition: agentinstance.cpp:55
Only fetch the base collection.
Definition: collectionfetchjob.h:62
Attribute * attribute(const QByteArray &name) const
Returns the attribute of the given type name if available, 0 otherwise.
Definition: entity.cpp:165
void removeAttribute(const QByteArray &name)
Removes and deletes the attribute of the given type name.
Definition: entity.cpp:140
Akonadi::Collection defaultCollection(const QByteArray &type) const
Returns the special collection of given type in the default resource, or an invalid collection if suc...
Definition: specialcollections.cpp:277
void forgetFoldersForResource(const QString &resourceId)
Forgets all folders owned by the given resource.
Definition: specialcollections.cpp:163
AgentInstance instance(const QString &identifier) const
Returns the agent instance with the given identifier or an invalid agent instance if the identifier d...
Definition: agentmanager.cpp:404
~SpecialCollections()
Destroys the special collections object.
Definition: specialcollections.cpp:189
Akonadi::Collection collection(const QByteArray &type, const AgentInstance &instance) const
Returns the special collection of the given type in the given agent instance, or an invalid collectio...
Definition: specialcollections.cpp:199
SpecialCollections(KCoreConfigSkeleton *config, QObject *parent=0)
Creates a new special collections object.
Definition: specialcollections.cpp:183
SpecialCollectionsPrivate(KCoreConfigSkeleton *settings, SpecialCollections *qq)
Definition: specialcollections.cpp:41
void endBatchRegister()
Definition: specialcollections.cpp:151
void setCollectionType(const QByteArray &type)
Sets the special collections type of the collection.
Definition: specialcollectionattribute.cpp:69
bool hasAttribute(const QByteArray &name) const
Returns true if the entity has an attribute of the given type name, false otherwise.
Definition: entity.cpp:146
QByteArray collectionType() const
Returns the special collections type of the collection.
Definition: specialcollectionattribute.cpp:74
static AgentManager * self()
Returns the global instance of the agent manager.
Definition: agentmanager.cpp:380
QString resource() const
Returns the identifier of the resource owning the collection.
Definition: collection.cpp:207
static void unsetSpecialCollection(const Akonadi::Collection &collection)
unsets the special collection attribute which marks collection as being a special collection...
Definition: specialcollections.cpp:214
bool unregisterCollection(const Collection &collection)
Unregisters the given collection as a spec ial collection.
Definition: specialcollections.cpp:223
No ancestor retrieval at all (the default)
Definition: collectionfetchscope.h:75
static void setSpecialCollectionType(const QByteArray &type, const Akonadi::Collection &collection)
Sets the special collection attribute which marks collection as being a special collection of type ty...
Definition: specialcollections.cpp:204
void collectionsChanged(const Akonadi::AgentInstance &instance)
Emitted when the special collections for a resource have been changed (for example, some become available, or some become unavailable).
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.