Akonadi
notificationcollector.cpp
49void NotificationCollector::itemAdded(const PimItem &item, bool seen, const Collection &collection, const QByteArray &resource)
53 itemNotification(Protocol::ItemChangeNotification::Add, item, collection, Collection(), resource);
56void NotificationCollector::itemChanged(const PimItem &item, const QSet<QByteArray> &changedParts, const Collection &collection, const QByteArray &resource)
59 itemNotification(Protocol::ItemChangeNotification::Modify, item, collection, Collection(), resource, changedParts);
68 int seenCount = (addedFlags.contains(AKONADI_FLAG_SEEN) || addedFlags.contains(AKONADI_FLAG_IGNORED) ? items.count() : 0);
69 seenCount -= (removedFlags.contains(AKONADI_FLAG_SEEN) || removedFlags.contains(AKONADI_FLAG_IGNORED) ? items.count() : 0);
72 itemNotification(Protocol::ItemChangeNotification::ModifyFlags, items, collection, Collection(), resource, QSet<QByteArray>(), addedFlags, removedFlags);
102void NotificationCollector::itemsRemoved(const PimItem::List &items, const Collection &collection, const QByteArray &resource)
104 itemNotification(Protocol::ItemChangeNotification::Remove, items, collection, Collection(), resource);
107void NotificationCollector::itemsLinked(const PimItem::List &items, const Collection &collection)
109 itemNotification(Protocol::ItemChangeNotification::Link, items, collection, Collection(), QByteArray());
112void NotificationCollector::itemsUnlinked(const PimItem::List &items, const Collection &collection)
114 itemNotification(Protocol::ItemChangeNotification::Unlink, items, collection, Collection(), QByteArray());
117void NotificationCollector::collectionAdded(const Collection &collection, const QByteArray &resource)
126void NotificationCollector::collectionChanged(const Collection &collection, const QList<QByteArray> &changes, const QByteArray &resource)
138void NotificationCollector::collectionMoved(const Collection &collection, const Collection &source, const QByteArray &resource, const QByteArray &destResource)
153void NotificationCollector::collectionRemoved(const Collection &collection, const QByteArray &resource)
163void NotificationCollector::collectionSubscribed(const Collection &collection, const QByteArray &resource)
169 collectionNotification(Protocol::CollectionChangeNotification::Subscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
172void NotificationCollector::collectionUnsubscribed(const Collection &collection, const QByteArray &resource)
179 collectionNotification(Protocol::CollectionChangeNotification::Unsubscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
192void NotificationCollector::tagRemoved(const Tag &tag, const QByteArray &resource, const QString &remoteId)
247 if ((op == Protocol::ItemChangeNotification::Modify) || (op == Protocol::ItemChangeNotification::ModifyFlags)
326 if (msg->operation() != Protocol::ItemChangeNotification::Add && msg->operation() != Protocol::ItemChangeNotification::ModifyFlags) {
332void NotificationCollector::collectionNotification(Protocol::CollectionChangeNotification::Operation op,
366 msgCollection = HandlerHelper::fetchCollectionsResponse(mAkonadi, col, {}, false, 0, {}, {}, mimeTypes);
373 msgCollection.setStatistics(Protocol::FetchCollectionStatsResponse(stats.count, stats.count - stats.read, stats.size));
383 qb.addValueCondition(CollectionAttribute::collectionIdFullColumnName(), Query::Equals, msgCollection.id());
390 qCWarning(AKONADISERVER_LOG) << "NotificationCollector failed to query attributes for Collection" << collection.name() << "(ID"
415void NotificationCollector::tagNotification(Protocol::TagChangeNotification::Operation op, const Tag &tag, const QByteArray &resource, const QString &remoteId)
434 msgTag = HandlerHelper::fetchTagsResponse(Tag::retrieveById(msgTag.id()), fetchScope->toFetchScope(), mConnection);
450 qCWarning(AKONADISERVER_LOG) << "NotificationCollection failed to query attributes for Tag" << tag.id();
472 return std::any_of(addedTags.cbegin(), addedTags.cend(), needsFetch) || std::any_of(removedTags.cbegin(), removedTags.cend(), needsFetch);
475void NotificationCollector::completeNotification(const Protocol::ChangeNotificationPtr &changeMsg)
482 qCWarning(AKONADISERVER_LOG) << "NotificationCollector requested FetchHelper from within a transaction."
514 ItemFetchHelper helper(mConnection, context, Scope(ids), itemFetchScope, tagFetchScope, mAkonadi);
525 qCWarning(AKONADISERVER_LOG) << "NotificationCollector failed to retrieve Items for notification!";
558 TagFetchHelper helper(mConnection, Scope((addedIds + removedIds) | Actions::toQList), tagScope->toFetchScope());
571 qCWarning(AKONADISERVER_LOG) << "NotificationCollector failed to retrieve Tags for notification!";
609 QMetaObject::invokeMethod(mgr, "slotNotify", Qt::QueuedConnection, Q_ARG(Akonadi::Protocol::ChangeNotificationList, msgs));
An Connection represents one connection of a client to the server.
Definition connection.h:39
QList< Collection > virtualCollections(const PimItem &item)
Returns all virtual collections the item is linked to.
Definition datastore.cpp:1022
bool inTransaction() const
Returns true if there is a transaction in progress.
Definition datastore.cpp:1423
void transactionRolledBack()
Emitted if a transaction has been aborted.
void transactionCommitted()
Emitted if a transaction has been successfully committed.
static Protocol::FetchCollectionsResponse fetchCollectionsResponse(AkonadiServer &akonadi, const Collection &col)
Returns the protocol representation of the given collection.
Definition handlerhelper.cpp:82
void collectionRemoved(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a removed collection.
Definition notificationcollector.cpp:153
void itemsMoved(const PimItem::List &items, const Collection &collectionSrc=Collection(), const Collection &collectionDest=Collection(), const QByteArray &sourceResource=QByteArray())
Notify about moved items Provide as many parameters as you have at hand currently,...
Definition notificationcollector.cpp:93
void tagRemoved(const Tag &tag, const QByteArray &resource, const QString &remoteId)
Notify about a removed tag.
Definition notificationcollector.cpp:192
void itemsTagsChanged(const PimItem::List &items, const QList< Tag > &addedTags, const QList< Tag > &removedTags, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about changed items tags.
Definition notificationcollector.cpp:75
void itemsUnlinked(const PimItem::List &items, const Collection &collection)
Notify about unlinked items.
Definition notificationcollector.cpp:112
void collectionMoved(const Collection &collection, const Collection &source, const QByteArray &resource=QByteArray(), const QByteArray &destResource=QByteArray())
Notify about a moved collection.
Definition notificationcollector.cpp:138
bool dispatchNotifications()
Trigger sending of collected notifications.
Definition notificationcollector.cpp:592
NotificationCollector(AkonadiServer &akonadi, DataStore *db)
Create a new notification collector for the given DataStore db.
Definition notificationcollector.cpp:33
void collectionChanged(const Collection &collection, const QList< QByteArray > &changes, const QByteArray &resource=QByteArray())
Notify about a changed collection.
Definition notificationcollector.cpp:126
void setConnection(Connection *connection)
Sets the connection that is causing the changes.
Definition notificationcollector.cpp:202
void itemsLinked(const PimItem::List &items, const Collection &collection)
Notify about linked items.
Definition notificationcollector.cpp:107
void itemsRemoved(const PimItem::List &items, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about removed items.
Definition notificationcollector.cpp:102
void collectionUnsubscribed(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a collection unsubscription.
Definition notificationcollector.cpp:172
void collectionAdded(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a added collection.
Definition notificationcollector.cpp:117
void itemsFlagsChanged(const PimItem::List &items, const QSet< QByteArray > &addedFlags, const QSet< QByteArray > &removedFlags, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about changed items flags Provide as many parameters as you have at hand currently,...
Definition notificationcollector.cpp:62
void itemChanged(const PimItem &item, const QSet< QByteArray > &changedParts, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about a changed item.
Definition notificationcollector.cpp:56
void collectionSubscribed(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a collection subscription.
Definition notificationcollector.cpp:163
void itemAdded(const PimItem &item, bool seen, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about an added item.
Definition notificationcollector.cpp:49
void addValueCondition(const QString &column, Query::CompareOperator op, const QVariant &value, ConditionType type=WhereCondition)
Add a WHERE or HAVING condition which compares a column with a given value.
Definition querybuilder.cpp:258
void addCondition(const Query::Condition &condition, ConditionType type=WhereCondition)
Add a WHERE condition.
Definition querybuilder.cpp:760
void addColumn(const QString &col)
Adds the given column to a select query.
Definition querybuilder.cpp:624
Helper class for creating and executing database SELECT queries.
Definition selectquerybuilder.h:21
Helper integration between Akonadi and Qt.
const QList< QKeySequence > & copy()
bool isEmpty() const const
bool isNull() const const
iterator insert(const Key &key, const T &value)
void reserve(qsizetype size)
T value(const Key &key) const const
void append(QList< T > &&value)
const_iterator cbegin() const const
const_iterator cend() const const
bool contains(const AT &value) const const
T & first()
void push_back(parameter_type value)
void reserve(qsizetype size)
qsizetype size() const const
const_iterator cbegin() const const
const_iterator constEnd() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
QByteArray toLatin1() const const
QByteArray toUtf8() const const
QueuedConnection
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.