inline bool qCompare(const Akonadi::Tag &left, const Akonadi::Tag &right, const char *actual, const char *expected, const char *file, int line) { return zCompareHelper((left == right) && (left.name() == right.name()), left, right, actual, expected, file, line); }
void Serializer::updateTagFromAkonadiTag(Domain::Tag::Ptr tag, Akonadi::Tag akonadiTag) { if (!isAkonadiTag(akonadiTag)) return; tag->setProperty("tagId", akonadiTag.id()); tag->setName(akonadiTag.name()); }
void Serializer::updateContextFromTag(Domain::Context::Ptr context, Akonadi::Tag tag) { if (!isContext(tag)) return; context->setProperty("tagId", tag.id()); context->setName(tag.name()); }
QByteArray EwsTagStore::serializeTag(const Akonadi::Tag &tag) const { QByteArray tagData; QDataStream stream(&tagData, QIODevice::WriteOnly); stream.setVersion(TagDataVer1StreamVer); stream << TagDataVer1; stream << tag.name() << tag.gid(); Attribute::List attrs = tag.attributes(); stream << (int)attrs.size(); Q_FOREACH(const Attribute *attr, attrs) { stream << attr->type(); stream << attr->serialized(); }