akonadi
protocolhelper.cpp
87 void ProtocolHelper::parseAncestorsCached( const QByteArray &data, Entity *entity, Collection::Id parentCollection,
145 int ProtocolHelper::parseCollection(const QByteArray & data, Collection & collection, int start)
252 QByteArray ProtocolHelper::encodePartIdentifier(PartNamespace ns, const QByteArray & label, int version )
254 const QByteArray versionString( version != 0 ? QByteArray(QByteArray("[") + QByteArray::number( version ) + QByteArray("]")) : "" );
282 QByteArray ProtocolHelper::entitySetToByteArray( const QList<Item> &_objects, const QByteArray &command )
288 std::sort( objects.begin(), objects.end(), boost::bind( &Item::id, _1 ) < boost::bind( &Item::id, _2 ) );
325 std::sort( objects.begin(), objects.end(), boost::bind( &Tag::id, _1 ) < boost::bind( &Tag::id, _2 ) );
338 QByteArray ProtocolHelper::tagSetToByteArray( const Tag::List &_objects, const QByteArray &command )
346 std::sort( objects.begin(), objects.end(), boost::bind( &Tag::id, _1 ) < boost::bind( &Tag::id, _2 ) );
365 QByteArray ProtocolHelper::commandContextToByteArray(const Akonadi::Collection &collection, const Akonadi::Tag &tag,
387 r += " " AKONADI_PARAM_COLLECTION " " + ImapParser::quote(collection.remoteId().toUtf8()) + ' ';
402 return '(' + QByteArray::number( col.id() ) + ' ' + ImapParser::quote( col.remoteId().toUtf8() ) + ") " + parentHrid;
408 return '(' + QByteArray::number( item.id() ) + ' ' + ImapParser::quote( item.remoteId().toUtf8() ) + ") " + parentHrid;
438 command += " " AKONADI_PARAM_CHANGEDSINCE " " + QByteArray::number( fetchScope.fetchChangedSince().toTime_t() );
480 static Item::Flags convertFlags( const QList<QByteArray>& flags, ProtocolHelperValuePool *valuePool )
483 // When the compiler supports thread-safe static initialization (mandated by the C++11 memory model)
485 // NOTE: GCC and clang has threadsafe static initialization for some time now, even without C++11.
503 void ProtocolHelper::parseItemFetchResult( const QList<QByteArray> &lineTokens, Item &item, ProtocolHelperValuePool *valuePool )
640 //kDebug() << "Payload is external: " << isExternal << " filename: " << lineTokens.value( i + 1 );
708 fullRelPath += QDir::separator() + QLatin1String("instance") + QDir::separator() + Akonadi::ServerManager::instanceIdentifier();
717 return akonadiStoragePath() + QDir::separator() + QLatin1String("file_db_data") + QDir::separator() + fileName;
723 bool ProtocolHelper::streamPayloadToFile(const QByteArray &command, const QByteArray &data, QByteArray &error)
757 QByteArray ProtocolHelper::listPreference(Collection::ListPurpose purpose, Collection::ListPreference preference)
static int parseCachePolicy(const QByteArray &data, CachePolicy &policy, int start=0)
Parse a cache policy definition.
Definition: protocolhelper.cpp:43
int intervalCheckTime() const
Returns the interval check time in minutes, -1 for never.
Definition: cachepolicy.cpp:118
void setSyncOnDemand(bool enable)
Sets whether the collection shall be synced automatically when necessary, i.e.
Definition: cachepolicy.cpp:133
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition: itemfetchscope.cpp:127
bool inheritFromParent() const
Returns whether it inherits cache policy from the parent collection.
Definition: cachepolicy.cpp:88
uint toUInt(bool *ok, int base) const
No ancestor retrieval at all (the default)
Definition: itemfetchscope.h:77
static QString instanceIdentifier()
Returns the identifier of the Akonadi instance we are connected to.
Definition: servermanager.cpp:284
int toInt(bool *ok, int base) const
void setCacheTimeout(int timeout)
Sets cache timeout for non-permanently cached parts.
Definition: cachepolicy.cpp:113
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
static QByteArray itemFetchScopeToByteArray(const ItemFetchScope &fetchScope)
Converts a given ItemFetchScope object into a protocol representation.
Definition: protocolhelper.cpp:411
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:33
static QByteArray entitySetToByteArray(const QList< T > &_objects, const QByteArray &command)
Converts the given set of items into a protocol representation.
Definition: protocolhelper_p.h:125
Attribute::List attributes() const
Returns a list of all attributes of the entity.
Definition: attributeentity.cpp:99
bool isEmpty() const
bool startsWith(const QByteArray &ba) const
virtual void deserialize(const QByteArray &data)=0
Sets the data of this attribute, using the same encoding as returned by toByteArray().
static QByteArray attributesToByteArray(const Entity &entity, bool ns=false)
Convert attributes to their protocol representation.
Definition: protocolhelper.cpp:232
bool fullPayload() const
Returns whether the full payload should be fetched.
Definition: itemfetchscope.cpp:65
bool fetchModificationTime() const
Returns whether item modification time should be retrieved.
Definition: itemfetchscope.cpp:142
QString join(const QString &separator) const
const_iterator insert(const T &value)
Parent class for entities that can have attributes.
Definition: attributeentity.h:40
QChar separator()
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition: entity.cpp:194
static int parseCollection(const QByteArray &data, Collection &collection, int start=0)
Parse a collection description.
Definition: protocolhelper.cpp:145
void setName(const QString &name)
Sets the i18n'ed name of the collection.
Definition: collection.cpp:93
int size() const
static QByteArray tagFetchScopeToByteArray(const TagFetchScope &fetchScope)
Converts a given TagFetchScope object into a protocol representation.
Definition: protocolhelper.cpp:468
T value(int i) const
void clear()
void setVirtual(bool isVirtual)
Sets whether the collection is virtual or not.
Definition: collection.cpp:266
int indexOf(char ch, int from) const
Disable collectoin for specified purpose.
Definition: collection.h:326
int count(const T &value) const
QString fromUtf8(const char *str, int size)
void clear()
Collection parentCollection() const
Returns the parent collection of this object.
Definition: entity.cpp:185
void setRemoteRevision(const QString &revision)
Sets the remote revision of the entity.
Definition: entity.cpp:87
void setStatistics(const CollectionStatistics &statistics)
Sets the collection statistics for the collection.
Definition: collection.cpp:243
Enable collection for specified purpose.
Definition: collection.h:325
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: itemfetchscope.cpp:75
Only retrieve the immediate parent collection.
Definition: itemfetchscope.h:78
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
Definition: collectionstatistics.cpp:82
bool fetchRemoteIdentification() const
Returns whether item remote identification should be retrieved.
Definition: itemfetchscope.cpp:182
bool isEmpty() const
bool isEmpty() const
QByteArray number(int n, int base)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QByteArray readAll()
static QByteArray hierarchicalRidToByteArray(const Collection &col)
Converts the given collection's hierarchical RID into a protocol representation.
Definition: protocolhelper.cpp:395
int cacheTimeout() const
Returns the cache timeout for non-permanently cached parts in minutes; -1 means indefinitely.
Definition: cachepolicy.cpp:108
void setSize(qint64 size)
Sets the total size of the items in this collection.
Definition: collectionstatistics.cpp:92
static QByteArray encodePartIdentifier(PartNamespace ns, const QByteArray &label, int version=0)
Encodes part label and namespace.
Definition: protocolhelper.cpp:252
bool fetchIdOnly() const
Sets wether only the id of the tags should be retieved or the complete tag.
Definition: tagfetchscope.cpp:79
T & first()
QByteArray mid(int pos, int len) const
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
void setCachePolicy(const CachePolicy &policy)
Sets the cache policy of the collection.
Definition: collection.cpp:254
static void deserialize(Item &item, const QByteArray &label, const QByteArray &data, int version, bool external)
throws ItemSerializerException on failure
Definition: itemserializer.cpp:84
QSet< QByteArray > payloadParts() const
Returns the payload parts that should be fetched.
Definition: itemfetchscope.cpp:51
KDateTime fetchChangedSince() const
Returns timestamp of the oldest item to fetch.
Definition: itemfetchscope.cpp:172
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:69
void setLocalListPreference(ListPurpose purpose, ListPreference preference)
Sets the local list preference for the specified purpose.
Definition: collection.cpp:288
void setLocalParts(const QStringList &parts)
Specifies the parts to permanently cache locally.
Definition: cachepolicy.cpp:103
static void parseAncestors(const QByteArray &data, Entity *entity, int start=0)
Convert a ancestor chain from its protocol representation into an Entity object.
Definition: protocolhelper.cpp:106
qlonglong toLongLong(bool *ok, int base) const
bool fetchGid() const
Returns whether item GID should be retrieved.
Definition: itemfetchscope.cpp:152
bool checkForCachedPayloadPartsOnly() const
Returns whether payload data should be fetched or only checked for presence in the cache...
Definition: itemfetchscope.cpp:122
static Attribute * createAttribute(const QByteArray &type)
Creates an entity attribute object of the given type.
Definition: attributefactory.cpp:147
QByteArray toLatin1() const
bool fetchVirtualReferences() const
Returns whether virtual references should be retrieved.
Definition: itemfetchscope.cpp:217
Definition: kcolumnfilterproxymodel_p.h:27
void setCount(qint64 count)
Sets the number of items in this collection.
Definition: collectionstatistics.cpp:72
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: tagfetchscope.cpp:59
Retrieve all ancestors, up to Collection::root()
Definition: itemfetchscope.h:79
static QByteArray decodePartIdentifier(const QByteArray &data, PartNamespace &ns)
Decode part label and namespace.
Definition: protocolhelper.cpp:268
void addAttribute(Attribute *attribute)
Adds an attribute to the entity.
Definition: attributeentity.cpp:74
int count() const
virtual QByteArray serialized() const =0
Returns a QByteArray representation of the attribute which will be storaged.
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition: itemfetchscope.cpp:162
QString fromLatin1(const char *str, int size)
QStringList localParts() const
Returns the parts to permanently cache locally.
Definition: cachepolicy.cpp:98
bool allAttributes() const
Returns whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:89
static void parseAncestorsCached(const QByteArray &data, Entity *entity, Collection::Id parentCollection, ProtocolHelperValuePool *valuePool=0, int start=0)
Convert a ancestor chain from its protocol representation into an Entity object.
Definition: protocolhelper.cpp:87
bool cacheOnly() const
Returns whether payload data should be requested from remote sources or just from the local cache...
Definition: itemfetchscope.cpp:104
static void parseItemFetchResult(const QList< QByteArray > &lineTokens, Item &item, ProtocolHelperValuePool *valuePool=0)
Parses a single line from an item fetch job result into an Item object.
Definition: protocolhelper.cpp:503
int size() const
void setReferenced(bool referenced)
Sets a collection to be referenced.
Definition: collection.cpp:338
int size() const
CollectionStatistics statistics() const
Returns the collection statistics of the collection.
Definition: collection.cpp:238
void setResource(const QString &identifier)
Sets the identifier of the resource owning the collection.
Definition: collection.cpp:212
void setInheritFromParent(bool inherit)
Sets whether the cache policy should be inherited from the parent collection.
Definition: cachepolicy.cpp:93
Attribute::List attributes() const
Returns a list of all attributes of the entity.
Definition: entity.cpp:153
void setContentMimeTypes(const QStringList &types)
Sets the list of possible content mime types.
Definition: collection.cpp:120
static bool hasInstanceIdentifier()
Returns true if we are connected to a non-default Akonadi server instance.
Definition: servermanager.cpp:289
bool syncOnDemand() const
Returns whether the collection will be synced automatically when necessary, i.e.
Definition: cachepolicy.cpp:128
static QByteArray cachePolicyToByteArray(const CachePolicy &policy)
Convert a cache policy object into its protocol representation.
Definition: protocolhelper.cpp:71
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.