akonadi
specialcollections.cpp
41SpecialCollectionsPrivate::SpecialCollectionsPrivate(KCoreConfigSkeleton *settings, SpecialCollections *qq)
55 QObject::connect(mMonitor, SIGNAL(collectionStatisticsChanged(Akonadi::Collection::Id,Akonadi::CollectionStatistics)),
117void 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!";
139 const Akonadi::CollectionStatistics statistics = fetchJob->property("statistics").value<Akonadi::CollectionStatistics>();
141 mFoldersForResource[collection.resource()][collection.name().toUtf8()].setStatistics(statistics);
194bool SpecialCollections::hasCollection(const QByteArray &type, const AgentInstance &instance) const
199Akonadi::Collection SpecialCollections::collection(const QByteArray &type, const AgentInstance &instance) const
204void 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);
244bool SpecialCollections::registerCollection(const QByteArray &type, const Collection &collection)
QString identifier() const
Returns the unique identifier of the agent instance.
Definition agentinstance.cpp:55
static AgentManager * self()
Returns the global instance of the agent manager.
Definition agentmanager.cpp:377
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:401
Job that fetches collections from the Akonadi storage.
Definition collectionfetchjob.h:54
CollectionFetchScope & fetchScope()
Returns the collection fetch scope.
Definition collectionfetchjob.cpp:439
Collection::List collections() const
Returns the list of fetched collection.
Definition collectionfetchjob.cpp:169
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition collectionfetchscope.cpp:138
Job that modifies a collection in the Akonadi storage.
Definition collectionmodifyjob.h:83
Provides statistics information of a Collection.
Definition collectionstatistics.h:70
QString resource() const
Returns the identifier of the resource owning the collection.
Definition collection.cpp:207
void removeAttribute(const QByteArray &name)
Removes and deletes the attribute of the given type name.
Definition entity.cpp:142
bool hasAttribute(const QByteArray &name) const
Returns true if the entity has an attribute of the given type name, false otherwise.
Definition entity.cpp:148
Attribute * attribute(const QByteArray &name) const
Returns the attribute of the given type name if available, 0 otherwise.
Definition entity.cpp:167
void setCollectionMonitored(const Collection &collection, bool monitored=true)
Sets whether the specified collection shall be monitored for changes.
Definition monitor.cpp:66
void fetchCollectionStatistics(bool enable)
Enables automatic fetching of changed collection statistics information from the Akonadi storage.
Definition monitor.cpp:225
An Attribute that stores the special collection type of a collection.
Definition specialcollectionattribute_p.h:40
QByteArray collectionType() const
Returns the special collections type of the collection.
Definition specialcollectionattribute.cpp:74
void endBatchRegister()
Definition specialcollections.cpp:151
SpecialCollectionsPrivate(KCoreConfigSkeleton *settings, SpecialCollections *qq)
Definition specialcollections.cpp:41
void forgetFoldersForResource(const QString &resourceId)
Forgets all folders owned by the given resource.
Definition specialcollections.cpp:163
void beginBatchRegister()
Avoids emitting the foldersChanged() signal until endBatchRegister() is called.
Definition specialcollections.cpp:144
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 defaultCollectionsChanged()
Emitted when the special collections for the default resource have been changed (for example,...
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
bool hasDefaultCollection(const QByteArray &type) const
Returns whether the default resource has a special collection of the given type.
Definition specialcollections.cpp:272
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
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
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
SpecialCollections(KCoreConfigSkeleton *config, QObject *parent=0)
Creates a new special collections object.
Definition specialcollections.cpp:183
void collectionsChanged(const Akonadi::AgentInstance &instance)
Emitted when the special collections for a resource have been changed (for example,...
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.