Akonadi
protocolhelper.cpp
69parseAncestorsCachedImpl(const QList<Protocol::Ancestor> &ancestors, T *entity, Collection::Id parentCollection, ProtocolHelperValuePool *pool)
93 attributes.insert(ProtocolHelper::encodePartIdentifier(ns ? ProtocolHelper::PartAttribute : ProtocolHelper::PartGlobal, attr->type()),
123void ProtocolHelper::parseAncestors(const QList<Protocol::Ancestor> &ancestors, Collection *collection)
158CollectionStatistics ProtocolHelper::parseCollectionStatistics(const Protocol::FetchCollectionStatsResponse &stats)
172void ProtocolHelper::parseAttributes(const Protocol::Attributes &attributes, Collection *collection)
197Protocol::Attributes ProtocolHelper::attributesToProtocol(const std::vector<Attribute *> &modifiedAttributes, bool ns)
201 attributes.insert(ProtocolHelper::encodePartIdentifier(ns ? ProtocolHelper::PartAttribute : ProtocolHelper::PartGlobal, attr->type()),
207Collection ProtocolHelper::parseCollection(const Protocol::FetchCollectionsResponse &data, bool requireParent)
225 collection.setLocalListPreference(Collection::ListDisplay, parsePreference(data.displayPref()));
288ProtocolHelper::commandContextToProtocol(const Akonadi::Collection &collection, const Akonadi::Tag &tag, const Item::List &requestedItems)
330 return Scope(QList<Scope::HRID>({Scope::HRID(item.id(), item.remoteId())}) + hierarchicalRidToScope(item.parentCollection()).hridChain());
333Protocol::ItemFetchScope ProtocolHelper::itemFetchScopeToProtocol(const ItemFetchScope &fetchScope)
338 parts += fetchScope.payloadParts() | Views::transform(std::bind(encodePartIdentifier, PartPayload, std::placeholders::_1)) | Actions::toQVector;
339 parts += fetchScope.attributes() | Views::transform(std::bind(encodePartIdentifier, PartAttribute, std::placeholders::_1)) | Actions::toQVector;
343 fs.setFetch(Protocol::ItemFetchScope::Flags | Protocol::ItemFetchScope::Size | Protocol::ItemFetchScope::RemoteID | Protocol::ItemFetchScope::RemoteRevision
349 fs.setFetch(Protocol::ItemFetchScope::CheckCachedPayloadPartsOnly, fetchScope.checkForCachedPayloadPartsOnly());
421 if (fetchScope.fetch(Protocol::ItemFetchScope::RemoteID) || fetchScope.fetch(Protocol::ItemFetchScope::RemoteRevision)) {
440Protocol::CollectionFetchScope ProtocolHelper::collectionFetchScopeToProtocol(const CollectionFetchScope &fetchScope)
485CollectionFetchScope ProtocolHelper::parseCollectionFetchScope(const Protocol::CollectionFetchScope &fetchScope)
559static Item::Flags convertFlags(const QList<QByteArray> &flags, ProtocolHelperValuePool *valuePool)
562 // When the compiler supports thread-safe static initialization (mandated by the C++11 memory model)
564 // NOTE: GCC and clang has threadsafe static initialization for some time now, even without C++11.
649 if (fetchScope && !fetchScope->fullPayload() && !fetchScope->payloadParts().contains(plainKey)) {
652 ItemSerializer::deserialize(item, plainKey, part.data(), metaData.version(), static_cast<ItemSerializer::PayloadStorage>(metaData.storageType()));
658 if (fetchScope && !fetchScope->allAttributes() && !fetchScope->attributes().contains(plainKey)) {
705bool ProtocolHelper::streamPayloadToFile(const QString &fileName, const QByteArray &data, QByteArray &error)
static Attribute * createAttribute(const QByteArray &type)
Creates an entity attribute object of the given type.
Definition attributefactory.cpp:139
virtual void deserialize(const QByteArray &data)=0
Sets the data of this attribute, using the same encoding as returned by toByteArray().
int cacheTimeout() const
Returns the cache timeout for non-permanently cached parts in minutes; -1 means indefinitely.
Definition cachepolicy.cpp:75
bool inheritFromParent() const
Returns whether it inherits cache policy from the parent collection.
Definition cachepolicy.cpp:55
int intervalCheckTime() const
Returns the interval check time in minutes, -1 for never.
Definition cachepolicy.cpp:85
void setLocalParts(const QStringList &parts)
Specifies the parts to permanently cache locally.
Definition cachepolicy.cpp:70
QStringList localParts() const
Returns the parts to permanently cache locally.
Definition cachepolicy.cpp:65
bool syncOnDemand() const
Returns whether the collection will be synced automatically when necessary, i.e.
Definition cachepolicy.cpp:95
void setCacheTimeout(int timeout)
Sets cache timeout for non-permanently cached parts.
Definition cachepolicy.cpp:80
void setInheritFromParent(bool inherit)
Sets whether the cache policy should be inherited from the parent collection.
Definition cachepolicy.cpp:60
void setSyncOnDemand(bool enable)
Sets whether the collection shall be synced automatically when necessary, i.e.
Definition cachepolicy.cpp:100
Specifies which parts of a collection should be fetched from the Akonadi storage.
Definition collectionfetchscope.h:56
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition collectionfetchscope.cpp:133
void setIncludeStatistics(bool include)
Sets whether collection statistics should be included in the retrieved results.
Definition collectionfetchscope.cpp:88
void setResource(const QString &resource)
Sets a resource filter, that is only collections owned by the specified resource are retrieved.
Definition collectionfetchscope.cpp:98
void setIgnoreRetrievalErrors(bool enabled)
Ignore retrieval errors while fetching collections, and always deliver what is available.
Definition collectionfetchscope.cpp:158
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition collectionfetchscope.cpp:138
void setFetchIdOnly(bool fetchIdOnly)
Sets whether only the id or the complete tag should be fetched.
Definition collectionfetchscope.cpp:148
void setContentMimeTypes(const QStringList &mimeTypes)
Sets a content mimetypes filter, that is only collections that contain at least one of the given mime...
Definition collectionfetchscope.cpp:108
CollectionFetchScope ancestorFetchScope() const
Returns the fetch scope for ancestor retrieval.
Definition collectionfetchscope.cpp:173
QStringList contentMimeTypes() const
Returns the content mimetypes filter.
Definition collectionfetchscope.cpp:103
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition collectionfetchscope.cpp:118
bool includeStatistics() const
Returns whether collection statistics should be included in the retrieved results.
Definition collectionfetchscope.cpp:83
QString resource() const
Returns the resource identifier that is used as filter.
Definition collectionfetchscope.cpp:93
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition collectionfetchscope.cpp:163
void setListFilter(ListFilter)
Sets a filter for the collections to be listed.
Definition collectionfetchscope.cpp:128
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition collectionfetchscope.cpp:113
bool fetchIdOnly() const
Sets whether only the id of the tags should be retrieved or the complete tag.
Definition collectionfetchscope.cpp:153
Provides statistics information of a Collection.
Definition core/collectionstatistics.h:59
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
Definition core/collectionstatistics.cpp:52
void setSize(qint64 size)
Sets the total size of the items in this collection.
Definition core/collectionstatistics.cpp:62
void setCount(qint64 count)
Sets the number of items in this collection.
Definition core/collectionstatistics.cpp:42
void setVirtual(bool isVirtual)
Sets whether the collection is virtual or not.
Definition collection.cpp:352
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition collection.cpp:204
void setLocalListPreference(ListPurpose purpose, ListPreference preference)
Sets the local list preference for the specified purpose.
Definition collection.cpp:368
void setName(const QString &name)
Sets the i18n'ed name of the collection.
Definition collection.cpp:221
void setRemoteId(const QString &id)
Sets the remote id of the collection.
Definition collection.cpp:101
void setResource(const QString &identifier)
Sets the identifier of the resource owning the collection.
Definition collection.cpp:307
void setCachePolicy(const CachePolicy &policy)
Sets the cache policy of the collection.
Definition collection.cpp:341
Collection parentCollection() const
Returns the parent collection of this object.
Definition collection.cpp:195
void setContentMimeTypes(const QStringList &types)
Sets the list of possible content mime types.
Definition collection.cpp:245
void setStatistics(const CollectionStatistics &statistics)
Sets the collection statistics for the collection.
Definition collection.cpp:331
Attribute * attribute(const QByteArray &name)
Returns the attribute of the given type name if available, 0 otherwise.
Definition collection.cpp:176
void setRemoteRevision(const QString &revision)
Sets the remote revision of the collection.
Definition collection.cpp:111
Base class for exceptions used by the Akonadi library.
Definition exceptionbase.h:30
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition itemfetchscope.h:58
bool fetchVirtualReferences() const
Returns whether virtual references should be retrieved.
Definition itemfetchscope.cpp:231
void setFetchRemoteIdentification(bool retrieveRid)
Fetch remote identification for items.
Definition itemfetchscope.cpp:191
bool allAttributes() const
Returns whether all available attributes should be fetched.
Definition itemfetchscope.cpp:100
void setCacheOnly(bool cacheOnly)
Sets whether payload data should be requested from remote sources or just from the local cache.
Definition itemfetchscope.cpp:123
bool fetchRemoteIdentification() const
Returns whether item remote identification should be retrieved.
Definition itemfetchscope.cpp:196
bool fullPayload() const
Returns whether the full payload should be fetched.
Definition itemfetchscope.cpp:76
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition itemfetchscope.cpp:91
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
Sets how many levels of ancestor collections should be included in the retrieval.
Definition itemfetchscope.cpp:146
bool cacheOnly() const
Returns whether payload data should be requested from remote sources or just from the local cache.
Definition itemfetchscope.cpp:118
QDateTime fetchChangedSince() const
Returns timestamp of the oldest item to fetch.
Definition itemfetchscope.cpp:186
bool fetchModificationTime() const
Returns whether item modification time should be retrieved.
Definition itemfetchscope.cpp:156
void setFetchGid(bool retrieveGID)
Enables retrieval of the item GID.
Definition itemfetchscope.cpp:161
bool checkForCachedPayloadPartsOnly() const
Returns whether payload data should be fetched or only checked for presence in the cache.
Definition itemfetchscope.cpp:136
void fetchAllAttributes(bool fetch=true)
Sets whether all available attributes should be fetched.
Definition itemfetchscope.cpp:105
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition itemfetchscope.cpp:86
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition itemfetchscope.cpp:176
QSet< QByteArray > payloadParts() const
Returns the payload parts that should be fetched.
Definition itemfetchscope.cpp:62
void setFetchModificationTime(bool retrieveMtime)
Enables retrieval of the item modification time.
Definition itemfetchscope.cpp:151
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition itemfetchscope.cpp:141
void setCheckForCachedPayloadPartsOnly(bool check=true)
Sets whether payload will be fetched or there will be only a test performed if the requested payload ...
Definition itemfetchscope.cpp:128
void setFetchVirtualReferences(bool fetchVRefs)
Returns whether to fetch list of virtual collections the item is linked to.
Definition itemfetchscope.cpp:226
void setFetchChangedSince(const QDateTime &changedSince)
Only fetch items that were added or modified after given timestamp.
Definition itemfetchscope.cpp:181
void fetchFullPayload(bool fetch=true)
Sets whether the full payload shall be fetched.
Definition itemfetchscope.cpp:81
void fetchPayloadPart(const QByteArray &part, bool fetch=true)
Sets which payload parts shall be fetched.
Definition itemfetchscope.cpp:67
void setIgnoreRetrievalErrors(bool enabled)
Ignore retrieval errors while fetching items, and always deliver what is available.
Definition itemfetchscope.cpp:171
An attribute to store query properties of persistent search collections.
Definition persistentsearchattribute.h:64
void setQueryString(const QString &query)
Sets the query string to be used for this search.
Definition persistentsearchattribute.cpp:38
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition tagfetchscope.h:23
void setFetchRemoteId(bool fetchRemoteId)
Sets whether to fetch tag remote ID.
Definition tagfetchscope.cpp:74
void setFetchAllAttributes(bool fetchAllAttributes)
Sets whether to fetch all attributes.
Definition tagfetchscope.cpp:84
void fetchAttribute(const QByteArray &type, bool fetch=true)
Sets whether the attribute of the given type should be fetched.
Definition tagfetchscope.cpp:54
bool fetchIdOnly() const
Sets whether only the id of the tags should be retrieved or the complete tag.
Definition tagfetchscope.cpp:69
bool fetchAllAttributes() const
Returns whether to fetch all attributes.
Definition tagfetchscope.cpp:89
void setFetchIdOnly(bool fetchIdOnly)
Sets whether only the id or the complete tag should be fetched.
Definition tagfetchscope.cpp:63
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition tagfetchscope.cpp:49
bool fetchRemoteId() const
Returns whether tag remote ID should be fetched.
Definition tagfetchscope.cpp:79
Helper integration between Akonadi and Qt.
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QString label(StandardShortcut id)
QByteArray mid(qsizetype pos, qsizetype len) const const
qsizetype size() const const
bool startsWith(QByteArrayView bv) const const
bool isValid() const const
ReadOnly
void append(QList< T > &&value)
T & first()
bool isEmpty() const const
void reserve(qsizetype size)
qsizetype size() const const
Flags
void setFlags(Flags flags)
void setSize(const QSizeF &size)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
void reserve(qsizetype size)
qsizetype size() const const
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.