8#include "datastream_p_p.h"
23#undef AKONADI_DECLARE_PRIVATE
24#define AKONADI_DECLARE_PRIVATE(Class) \
25 inline Class##Private *Class::d_func() \
27 return reinterpret_cast<Class##Private *>(d_ptr.data()); \
29 inline const Class##Private *Class::d_func() const \
31 return reinterpret_cast<const Class##Private *>(d_ptr.constData()); \
43 case Command::Invalid:
44 return dbg <<
"Invalid";
47 return dbg <<
"Hello";
49 return dbg <<
"Login";
51 return dbg <<
"Logout";
53 case Command::Transaction:
54 return dbg <<
"Transaction";
56 case Command::CreateItem:
57 return dbg <<
"CreateItem";
58 case Command::CopyItems:
59 return dbg <<
"CopyItems";
60 case Command::DeleteItems:
61 return dbg <<
"DeleteItems";
62 case Command::FetchItems:
63 return dbg <<
"FetchItems";
64 case Command::LinkItems:
65 return dbg <<
"LinkItems";
66 case Command::ModifyItems:
67 return dbg <<
"ModifyItems";
68 case Command::MoveItems:
69 return dbg <<
"MoveItems";
71 case Command::CreateCollection:
72 return dbg <<
"CreateCollection";
73 case Command::CopyCollection:
74 return dbg <<
"CopyCollection";
75 case Command::DeleteCollection:
76 return dbg <<
"DeleteCollection";
77 case Command::FetchCollections:
78 return dbg <<
"FetchCollections";
79 case Command::FetchCollectionStats:
80 return dbg <<
"FetchCollectionStats";
81 case Command::ModifyCollection:
82 return dbg <<
"ModifyCollection";
83 case Command::MoveCollection:
84 return dbg <<
"MoveCollection";
87 return dbg <<
"Search";
88 case Command::SearchResult:
89 return dbg <<
"SearchResult";
90 case Command::StoreSearch:
91 return dbg <<
"StoreSearch";
93 case Command::CreateTag:
94 return dbg <<
"CreateTag";
95 case Command::DeleteTag:
96 return dbg <<
"DeleteTag";
97 case Command::FetchTags:
98 return dbg <<
"FetchTags";
99 case Command::ModifyTag:
100 return dbg <<
"ModifyTag";
102 case Command::FetchRelations:
103 return dbg <<
"FetchRelations";
104 case Command::ModifyRelation:
105 return dbg <<
"ModifyRelation";
106 case Command::RemoveRelations:
107 return dbg <<
"RemoveRelations";
109 case Command::SelectResource:
110 return dbg <<
"SelectResource";
112 case Command::StreamPayload:
113 return dbg <<
"StreamPayload";
114 case Command::ItemChangeNotification:
115 return dbg <<
"ItemChangeNotification";
116 case Command::CollectionChangeNotification:
117 return dbg <<
"CollectionChangeNotification";
118 case Command::TagChangeNotification:
119 return dbg <<
"TagChangeNotification";
120 case Command::RelationChangeNotification:
121 return dbg <<
"RelationChangeNotification";
122 case Command::SubscriptionChangeNotification:
123 return dbg <<
"SubscriptionChangeNotification";
124 case Command::DebugChangeNotification:
125 return dbg <<
"DebugChangeNotification";
126 case Command::CreateSubscription:
127 return dbg <<
"CreateSubscription";
128 case Command::ModifySubscription:
129 return dbg <<
"ModifySubscription";
131 case Command::_ResponseBit:
133 return dbg << static_cast<int>(type);
137 return dbg << static_cast<int>(type);
143 Protocol::serialize(stream, ptr);
150 ptr = Protocol::deserialize(stream.device()).
staticCast<T>();
156Command::Command(quint8 type)
161bool Command::operator==(
const Command &other)
const
163 return mType == other.mType;
168 json[QStringLiteral(
"response")] =
static_cast<bool>(mType & Command::_ResponseBit);
170#define case_label(x) \
172 json[QStringLiteral("type")] = QStringLiteral(#x); \
175 switch (mType & ~Command::_ResponseBit) {
176 case_label(Invalid) case_label(Hello)
178 case_label(Login) case_label(Logout)
180 case_label(Transaction)
182 case_label(CreateItem) case_label(CopyItems) case_label(DeleteItems) case_label(FetchItems) case_label(LinkItems) case_label(ModifyItems)
183 case_label(MoveItems)
185 case_label(CreateCollection) case_label(CopyCollection) case_label(DeleteCollection) case_label(FetchCollections)
186 case_label(FetchCollectionStats) case_label(ModifyCollection) case_label(MoveCollection)
188 case_label(Search) case_label(SearchResult) case_label(StoreSearch)
190 case_label(CreateTag) case_label(DeleteTag) case_label(FetchTags) case_label(ModifyTag)
192 case_label(FetchRelations) case_label(ModifyRelation) case_label(RemoveRelations)
194 case_label(SelectResource)
196 case_label(StreamPayload) case_label(CreateSubscription) case_label(ModifySubscription)
198 case_label(DebugChangeNotification) case_label(ItemChangeNotification)
199 case_label(CollectionChangeNotification) case_label(TagChangeNotification)
200 case_label(RelationChangeNotification) case_label(SubscriptionChangeNotification)
205DataStream &
operator<<(DataStream &stream,
const Command &cmd)
207 return stream << cmd.mType;
210DataStream &
operator>>(DataStream &stream, Command &cmd)
212 return stream >> cmd.mType;
217 return dbg.
noquote() << ((cmd.mType & Command::_ResponseBit) ?
"Response:" :
"Command:") << static_cast<Command::Type>(cmd.mType & ~Command::_ResponseBit)
221void toJson(
const Akonadi::Protocol::Command *command,
QJsonObject &json)
223#define case_notificationlabel(x, class) \
225 static_cast<const Akonadi::Protocol::class *>(command)->toJson(json); \
227#define case_commandlabel(x, cmd, resp) \
229 static_cast<const Akonadi::Protocol::cmd *>(command)->toJson(json); \
231 case Command::x | Command::_ResponseBit: { \
232 static_cast<const Akonadi::Protocol::resp *>(command)->toJson(json); \
235 switch (command->mType) {
236 case Command::Invalid:
239 case Command::Hello | Command::_ResponseBit: {
240 static_cast<const Akonadi::Protocol::HelloResponse *
>(command)->toJson(json);
242 case_commandlabel(Login, LoginCommand, LoginResponse) case_commandlabel(Logout, LogoutCommand, LogoutResponse)
244 case_commandlabel(Transaction, TransactionCommand, TransactionResponse)
246 case_commandlabel(CreateItem, CreateItemCommand, CreateItemResponse) case_commandlabel(CopyItems, CopyItemsCommand, CopyItemsResponse)
247 case_commandlabel(DeleteItems, DeleteItemsCommand, DeleteItemsResponse) case_commandlabel(FetchItems, FetchItemsCommand, FetchItemsResponse)
248 case_commandlabel(LinkItems, LinkItemsCommand, LinkItemsResponse) case_commandlabel(
251 ModifyItemsResponse) case_commandlabel(MoveItems, MoveItemsCommand, MoveItemsResponse)
253 case_commandlabel(CreateCollection, CreateCollectionCommand, CreateCollectionResponse) case_commandlabel(
255 CopyCollectionCommand,
256 CopyCollectionResponse) case_commandlabel(DeleteCollection, DeleteCollectionCommand, DeleteCollectionResponse)
257 case_commandlabel(FetchCollections, FetchCollectionsCommand, FetchCollectionsResponse) case_commandlabel(
258 FetchCollectionStats,
259 FetchCollectionStatsCommand,
260 FetchCollectionStatsResponse) case_commandlabel(ModifyCollection, ModifyCollectionCommand, ModifyCollectionResponse)
261 case_commandlabel(MoveCollection, MoveCollectionCommand, MoveCollectionResponse)
263 case_commandlabel(Search, SearchCommand, SearchResponse) case_commandlabel(
266 SearchResultResponse) case_commandlabel(StoreSearch, StoreSearchCommand, StoreSearchResponse)
268 case_commandlabel(CreateTag, CreateTagCommand, CreateTagResponse)
269 case_commandlabel(DeleteTag, DeleteTagCommand, DeleteTagResponse)
270 case_commandlabel(FetchTags, FetchTagsCommand, FetchTagsResponse)
271 case_commandlabel(ModifyTag, ModifyTagCommand, ModifyTagResponse)
273 case_commandlabel(FetchRelations, FetchRelationsCommand, FetchRelationsResponse)
274 case_commandlabel(ModifyRelation, ModifyRelationCommand, ModifyRelationResponse)
275 case_commandlabel(RemoveRelations, RemoveRelationsCommand, RemoveRelationsResponse)
277 case_commandlabel(SelectResource, SelectResourceCommand, SelectResourceResponse)
279 case_commandlabel(StreamPayload, StreamPayloadCommand, StreamPayloadResponse)
282 CreateSubscriptionCommand,
283 CreateSubscriptionResponse) case_commandlabel(ModifySubscription,
284 ModifySubscriptionCommand,
285 ModifySubscriptionResponse)
287 case_notificationlabel(DebugChangeNotification, DebugChangeNotification)
288 case_notificationlabel(ItemChangeNotification, ItemChangeNotification)
289 case_notificationlabel(CollectionChangeNotification,
290 CollectionChangeNotification)
291 case_notificationlabel(TagChangeNotification,
292 TagChangeNotification)
293 case_notificationlabel(RelationChangeNotification,
294 RelationChangeNotification)
295 case_notificationlabel(SubscriptionChangeNotification,
296 SubscriptionChangeNotification)
298#undef case_notificationlabel
299#undef case_commandlabel
305 : Command(Command::Invalid | Command::_ResponseBit)
310Response::Response(Command::Type type)
311 : Command(
type | Command::_ResponseBit)
316bool Response::operator==(
const Response &other)
const
318 return *
static_cast<const Command *
>(
this) ==
static_cast<const Command &
>(other) && mErrorCode == other.mErrorCode && mErrorMsg == other.mErrorMsg;
323 static_cast<const Command *
>(
this)->toJson(json);
326 error[QStringLiteral(
"code")] = errorCode();
328 json[QStringLiteral(
"error")] =
error;
330 json[QStringLiteral(
"error")] =
false;
334DataStream &
operator<<(DataStream &stream,
const Response &cmd)
336 return stream << static_cast<const Command &>(cmd) << cmd.mErrorCode << cmd.mErrorMsg;
339DataStream &
operator>>(DataStream &stream, Response &cmd)
341 return stream >>
static_cast<Command &
>(cmd) >> cmd.mErrorCode >> cmd.mErrorMsg;
346 return dbg.
noquote() <<
static_cast<const Command &
>(resp) <<
"Error code:" << resp.mErrorCode <<
"\n"
347 <<
"Error msg:" << resp.mErrorMsg <<
"\n";
355 typedef CommandPtr (*CommandFactoryFunc)();
356 typedef ResponsePtr (*ResponseFactoryFunc)();
361 registerType<Command::Hello, Command , HelloResponse>();
362 registerType<Command::Login, LoginCommand, LoginResponse>();
363 registerType<Command::Logout, LogoutCommand, LogoutResponse>();
366 registerType<Command::Transaction, TransactionCommand, TransactionResponse>();
369 registerType<Command::CreateItem, CreateItemCommand, CreateItemResponse>();
370 registerType<Command::CopyItems, CopyItemsCommand, CopyItemsResponse>();
371 registerType<Command::DeleteItems, DeleteItemsCommand, DeleteItemsResponse>();
372 registerType<Command::FetchItems, FetchItemsCommand, FetchItemsResponse>();
373 registerType<Command::LinkItems, LinkItemsCommand, LinkItemsResponse>();
374 registerType<Command::ModifyItems, ModifyItemsCommand, ModifyItemsResponse>();
375 registerType<Command::MoveItems, MoveItemsCommand, MoveItemsResponse>();
378 registerType<Command::CreateCollection, CreateCollectionCommand, CreateCollectionResponse>();
379 registerType<Command::CopyCollection, CopyCollectionCommand, CopyCollectionResponse>();
380 registerType<Command::DeleteCollection, DeleteCollectionCommand, DeleteCollectionResponse>();
381 registerType<Command::FetchCollections, FetchCollectionsCommand, FetchCollectionsResponse>();
382 registerType<Command::FetchCollectionStats, FetchCollectionStatsCommand, FetchCollectionStatsResponse>();
383 registerType<Command::ModifyCollection, ModifyCollectionCommand, ModifyCollectionResponse>();
384 registerType<Command::MoveCollection, MoveCollectionCommand, MoveCollectionResponse>();
387 registerType<Command::Search, SearchCommand, SearchResponse>();
388 registerType<Command::SearchResult, SearchResultCommand, SearchResultResponse>();
389 registerType<Command::StoreSearch, StoreSearchCommand, StoreSearchResponse>();
392 registerType<Command::CreateTag, CreateTagCommand, CreateTagResponse>();
393 registerType<Command::DeleteTag, DeleteTagCommand, DeleteTagResponse>();
394 registerType<Command::FetchTags, FetchTagsCommand, FetchTagsResponse>();
395 registerType<Command::ModifyTag, ModifyTagCommand, ModifyTagResponse>();
398 registerType<Command::FetchRelations, FetchRelationsCommand, FetchRelationsResponse>();
399 registerType<Command::ModifyRelation, ModifyRelationCommand, ModifyRelationResponse>();
400 registerType<Command::RemoveRelations, RemoveRelationsCommand, RemoveRelationsResponse>();
403 registerType<Command::SelectResource, SelectResourceCommand, SelectResourceResponse>();
406 registerType<Command::StreamPayload, StreamPayloadCommand, StreamPayloadResponse>();
407 registerType<Command::ItemChangeNotification, ItemChangeNotification, Response >();
408 registerType<Command::CollectionChangeNotification, CollectionChangeNotification, Response >();
409 registerType<Command::TagChangeNotification, TagChangeNotification, Response >();
410 registerType<Command::RelationChangeNotification, RelationChangeNotification, Response >();
411 registerType<Command::SubscriptionChangeNotification, SubscriptionChangeNotification, Response >();
412 registerType<Command::DebugChangeNotification, DebugChangeNotification, Response >();
413 registerType<Command::CreateSubscription, CreateSubscriptionCommand, CreateSubscriptionResponse>();
414 registerType<Command::ModifySubscription, ModifySubscriptionCommand, ModifySubscriptionResponse>();
423 static CommandPtr commandFactoryFunc()
428 static ResponsePtr responseFactoryFunc()
433 template<Command::Type T,
typename CmdType,
typename RespType>
436 CommandFactoryFunc cmdFunc = &commandFactoryFunc<CmdType>;
437 ResponseFactoryFunc respFunc = &responseFactoryFunc<RespType>;
438 registrar.
insert(T, qMakePair(cmdFunc, respFunc));
442Q_GLOBAL_STATIC(FactoryPrivate, sFactoryPrivate)
444CommandPtr Factory::command(Command::Type type)
446 auto iter = sFactoryPrivate->registrar.constFind(type);
447 if (iter == sFactoryPrivate->registrar.constEnd()) {
450 return iter->first();
453ResponsePtr Factory::response(Command::Type type)
455 auto iter = sFactoryPrivate->registrar.constFind(type);
456 if (iter == sFactoryPrivate->registrar.constEnd()) {
459 return iter->second();
466bool ItemFetchScope::operator==(
const ItemFetchScope &other)
const
468 return mRequestedParts == other.mRequestedParts && mChangedSince == other.mChangedSince && mAncestorDepth == other.mAncestorDepth && mFlags == other.mFlags;
474 std::copy_if(mRequestedParts.begin(), mRequestedParts.end(), std::back_inserter(rv), [](
const QByteArray &ba) {
475 return ba.startsWith(
"PLD:");
480void ItemFetchScope::setFetch(FetchFlags attributes,
bool fetch)
483 mFlags |= attributes;
484 if (attributes & FullPayload) {
485 if (!mRequestedParts.contains(AKONADI_PARAM_PLD_RFC822)) {
486 mRequestedParts << AKONADI_PARAM_PLD_RFC822;
490 mFlags &= ~attributes;
494bool ItemFetchScope::fetch(FetchFlags flags)
const
497 return mFlags == None;
499 return mFlags & flags;
503void ItemFetchScope::toJson(
QJsonObject &json)
const
505 json[QStringLiteral(
"flags")] =
static_cast<int>(mFlags);
506 json[QStringLiteral(
"ChangedSince")] = mChangedSince.toString();
507 json[QStringLiteral(
"AncestorDepth")] =
static_cast<std::underlying_type<AncestorDepth>::type
>(mAncestorDepth);
510 for (
const auto &part :
std::as_const(mRequestedParts)) {
513 json[QStringLiteral(
"RequestedParts")] = requestedPartsArray;
519 case ItemFetchScope::NoAncestor:
520 return dbg <<
"No ancestor";
521 case ItemFetchScope::ParentAncestor:
522 return dbg <<
"Parent ancestor";
523 case ItemFetchScope::AllAncestors:
524 return dbg <<
"All ancestors";
529DataStream &
operator<<(DataStream &stream,
const ItemFetchScope &scope)
531 return stream << scope.mRequestedParts << scope.mChangedSince << scope.mAncestorDepth << scope.mFlags;
534DataStream &
operator>>(DataStream &stream, ItemFetchScope &scope)
536 return stream >> scope.mRequestedParts >> scope.mChangedSince >> scope.mAncestorDepth >> scope.mFlags;
541 return dbg.
noquote() <<
"FetchScope(\n"
542 <<
"Fetch Flags:" << scope.mFlags <<
"\n"
543 <<
"Changed Since:" << scope.mChangedSince <<
"\n"
544 <<
"Ancestor Depth:" << scope.mAncestorDepth <<
"\n"
545 <<
"Requested Parts:" << scope.mRequestedParts <<
")\n";
550ScopeContext::ScopeContext(Type type, qint64
id)
552 if (type == ScopeContext::Tag) {
554 }
else if (type == ScopeContext::Collection) {
559ScopeContext::ScopeContext(Type type,
const QString &ctx)
561 if (type == ScopeContext::Tag) {
563 }
else if (type == ScopeContext::Collection) {
568bool ScopeContext::operator==(
const ScopeContext &other)
const
570 return mColCtx == other.mColCtx && mTagCtx == other.mTagCtx;
576 json[QStringLiteral(
"scopeContext")] =
false;
577 }
else if (hasContextId(ScopeContext::Tag)) {
578 json[QStringLiteral(
"scopeContext")] = QStringLiteral(
"tag");
579 json[QStringLiteral(
"TagID")] = contextId(ScopeContext::Tag);
580 }
else if (hasContextId(ScopeContext::Collection)) {
581 json[QStringLiteral(
"scopeContext")] = QStringLiteral(
"collection");
582 json[QStringLiteral(
"ColID")] = contextId(ScopeContext::Collection);
583 }
else if (hasContextRID(ScopeContext::Tag)) {
584 json[QStringLiteral(
"scopeContext")] = QStringLiteral(
"tagrid");
585 json[QStringLiteral(
"TagRID")] = contextRID(ScopeContext::Tag);
586 }
else if (hasContextRID(ScopeContext::Collection)) {
587 json[QStringLiteral(
"scopeContext")] = QStringLiteral(
"colrid");
588 json[QStringLiteral(
"ColRID")] = contextRID(ScopeContext::Collection);
592DataStream &
operator<<(DataStream &stream,
const ScopeContext &context)
597 auto vType = context.mColCtx.typeId();
600 stream << context.mColCtx.toLongLong();
602 stream << context.mColCtx.toString();
605 vType = context.mTagCtx.typeId();
608 stream << context.mTagCtx.toLongLong();
610 stream << context.mTagCtx.toString();
616DataStream &
operator>>(DataStream &stream, ScopeContext &context)
622 for (ScopeContext::Type type : {ScopeContext::Collection, ScopeContext::Tag}) {
626 context.setContext(type,
id);
629 context.setContext(type, rid);
639 dbg <<
"ScopeContext(";
642 }
else if (ctx.hasContextId(ScopeContext::Tag)) {
643 dbg <<
"Tag ID:" << ctx.contextId(ScopeContext::Tag);
644 }
else if (ctx.hasContextId(ScopeContext::Collection)) {
645 dbg <<
"Col ID:" << ctx.contextId(ScopeContext::Collection);
646 }
else if (ctx.hasContextRID(ScopeContext::Tag)) {
647 dbg <<
"Tag RID:" << ctx.contextRID(ScopeContext::Tag);
648 }
else if (ctx.hasContextRID(ScopeContext::Collection)) {
649 dbg <<
"Col RID:" << ctx.contextRID(ScopeContext::Collection);
656ChangeNotification::ChangeNotification(Command::Type type)
661bool ChangeNotification::operator==(
const ChangeNotification &other)
const
663 return static_cast<const Command &
>(*this) == other && mSessionId == other.mSessionId;
671 std::transform(items.
cbegin(), items.
cend(), std::back_inserter(rv), [](
const FetchItemsResponse &item) {
677bool ChangeNotification::isRemove()
const
680 case Command::Invalid:
682 case Command::ItemChangeNotification:
683 return static_cast<const class ItemChangeNotification *
>(
this)->operation() == ItemChangeNotification::Remove;
684 case Command::CollectionChangeNotification:
685 return static_cast<const class CollectionChangeNotification *
>(
this)->operation() == CollectionChangeNotification::Remove;
686 case Command::TagChangeNotification:
687 return static_cast<const class TagChangeNotification *
>(
this)->operation() == TagChangeNotification::Remove;
688 case Command::RelationChangeNotification:
689 return static_cast<const class RelationChangeNotification *
>(
this)->operation() == RelationChangeNotification::Remove;
690 case Command::SubscriptionChangeNotification:
691 return static_cast<const class SubscriptionChangeNotification *
>(
this)->operation() == SubscriptionChangeNotification::Remove;
692 case Command::DebugChangeNotification:
695 Q_ASSERT_X(
false, __FUNCTION__,
"Unknown ChangeNotification type");
701bool ChangeNotification::isMove()
const
704 case Command::Invalid:
706 case Command::ItemChangeNotification:
707 return static_cast<const class ItemChangeNotification *
>(
this)->operation() == ItemChangeNotification::Move;
708 case Command::CollectionChangeNotification:
709 return static_cast<const class CollectionChangeNotification *
>(
this)->operation() == CollectionChangeNotification::Move;
710 case Command::TagChangeNotification:
711 case Command::RelationChangeNotification:
712 case Command::SubscriptionChangeNotification:
713 case Command::DebugChangeNotification:
716 Q_ASSERT_X(
false, __FUNCTION__,
"Unknown ChangeNotification type");
722bool ChangeNotification::appendAndCompress(ChangeNotificationList &list,
const ChangeNotificationPtr &msg)
725 static const int maxCompressionSearchLength = 10;
726 int searchCounter = 0;
730 if (msg->type() == Command::CollectionChangeNotification) {
731 const auto &cmsg = Protocol::cmdCast<class CollectionChangeNotification>(msg);
732 if (cmsg.operation() == CollectionChangeNotification::Modify) {
737 if ((*iter)->type() == Protocol::Command::CollectionChangeNotification) {
738 auto &it = Protocol::cmdCast<class CollectionChangeNotification>(*iter);
739 const auto &msgCol = cmsg.collection();
740 const auto &itCol = it.collection();
741 if (msgCol.id() == itCol.id() && msgCol.remoteId() == itCol.remoteId() && msgCol.remoteRevision() == itCol.remoteRevision()
742 && msgCol.resource() == itCol.resource() && cmsg.destinationResource() == it.destinationResource()
743 && cmsg.parentCollection() == it.parentCollection() && cmsg.parentDestCollection() == it.parentDestCollection()) {
745 if (cmsg.operation() == CollectionChangeNotification::Modify && it.operation() == CollectionChangeNotification::Modify) {
746 const auto parts = it.changedParts();
747 it.setChangedParts(parts + cmsg.changedParts());
752 if (it.operation() == CollectionChangeNotification::Add) {
758 if (searchCounter >= maxCompressionSearchLength) {
770void ChangeNotification::toJson(
QJsonObject &json)
const
772 static_cast<const Command *
>(
this)->toJson(json);
776 for (
const auto &m :
std::as_const(mMetaData)) {
779 json[QStringLiteral(
"metadata")] = metadata;
782DataStream &
operator<<(DataStream &stream,
const ChangeNotification &ntf)
784 return stream << static_cast<const Command &>(ntf) << ntf.mSessionId;
787DataStream &
operator>>(DataStream &stream, ChangeNotification &ntf)
789 return stream >>
static_cast<Command &
>(ntf) >> ntf.mSessionId;
794 return dbg.
noquote() <<
static_cast<const Command &
>(ntf) <<
"Session:" << ntf.mSessionId <<
"\n"
795 <<
"MetaData:" << ntf.mMetaData <<
"\n";
798DataStream &
operator>>(DataStream &stream, ChangeNotification::Relation &relation)
800 return stream >> relation.type >> relation.leftId >> relation.rightId;
803DataStream &
operator<<(DataStream &stream,
const ChangeNotification::Relation &relation)
805 return stream << relation.type << relation.leftId << relation.rightId;
811 return dbg <<
"Left: " << rel.leftId <<
", Right:" << rel.rightId <<
", Type: " << rel.type;
822template<
typename Value,
template<
typename>
class Container>
823inline bool containerComparator(
const Container<Value> &c1,
const Container<Value> &c2)
828template<
typename T,
template<
typename>
class Container>
831 if (c1.size() != c2.size()) {
835 for (
auto it1 = c1.cbegin(), it2 = c2.cbegin(), end1 = c1.cend(); it1 != end1; ++it1, ++it2) {
836 if (**it1 != **it2) {
849#include "protocol_gen.cpp"
Helper integration between Akonadi and Qt.
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
const QList< QKeySequence > & begin()
QDebug operator<<(QDebug dbg, const PerceptualColor::LchaDouble &value)
A glue between Qt and the standard library.
QHash::iterator insert(const Key &key, const T &value)
void append(const QJsonValue &value)
void append(const T &value)
QList::const_iterator cbegin() const const
QList::const_iterator cend() const const
QSharedPointer< T > create(Args &&... args)
QSharedPointer< X > staticCast() const const
QString fromUtf8(const char *str, int size)