Akonadi
notificationcollector.cpp
46void NotificationCollector::itemAdded(const PimItem &item, bool seen, const Collection &collection, const QByteArray &resource)
50 itemNotification(Protocol::ItemChangeNotification::Add, item, collection, Collection(), resource);
53void NotificationCollector::itemChanged(const PimItem &item, const QSet<QByteArray> &changedParts, const Collection &collection, const QByteArray &resource)
56 itemNotification(Protocol::ItemChangeNotification::Modify, item, collection, Collection(), resource, changedParts);
65 int seenCount = (addedFlags.contains(AKONADI_FLAG_SEEN) || addedFlags.contains(AKONADI_FLAG_IGNORED) ? items.count() : 0);
66 seenCount -= (removedFlags.contains(AKONADI_FLAG_SEEN) || removedFlags.contains(AKONADI_FLAG_IGNORED) ? items.count() : 0);
69 itemNotification(Protocol::ItemChangeNotification::ModifyFlags, items, collection, Collection(), resource, QSet<QByteArray>(), addedFlags, removedFlags);
99void NotificationCollector::itemsRemoved(const PimItem::List &items, const Collection &collection, const QByteArray &resource)
101 itemNotification(Protocol::ItemChangeNotification::Remove, items, collection, Collection(), resource);
104void NotificationCollector::itemsLinked(const PimItem::List &items, const Collection &collection)
106 itemNotification(Protocol::ItemChangeNotification::Link, items, collection, Collection(), QByteArray());
109void NotificationCollector::itemsUnlinked(const PimItem::List &items, const Collection &collection)
111 itemNotification(Protocol::ItemChangeNotification::Unlink, items, collection, Collection(), QByteArray());
114void NotificationCollector::collectionAdded(const Collection &collection, const QByteArray &resource)
123void NotificationCollector::collectionChanged(const Collection &collection, const QList<QByteArray> &changes, const QByteArray &resource)
140void NotificationCollector::collectionMoved(const Collection &collection, const Collection &source, const QByteArray &resource, const QByteArray &destResource)
155void NotificationCollector::collectionRemoved(const Collection &collection, const QByteArray &resource)
165void NotificationCollector::collectionSubscribed(const Collection &collection, const QByteArray &resource)
171 collectionNotification(Protocol::CollectionChangeNotification::Subscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
174void NotificationCollector::collectionUnsubscribed(const Collection &collection, const QByteArray &resource)
181 collectionNotification(Protocol::CollectionChangeNotification::Unsubscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
194void NotificationCollector::tagRemoved(const Tag &tag, const QByteArray &resource, const QString &remoteId)
239 if ((op == Protocol::ItemChangeNotification::Modify) || (op == Protocol::ItemChangeNotification::ModifyFlags)
318 if (msg->operation() != Protocol::ItemChangeNotification::Add && msg->operation() != Protocol::ItemChangeNotification::ModifyFlags) {
324void NotificationCollector::collectionNotification(Protocol::CollectionChangeNotification::Operation op,
358 msgCollection = HandlerHelper::fetchCollectionsResponse(mAkonadi, col, {}, false, 0, {}, {}, mimeTypes);
365 msgCollection.setStatistics(Protocol::FetchCollectionStatsResponse(stats.count, stats.count - stats.read, stats.size));
375 qb.addValueCondition(CollectionAttribute::collectionIdFullColumnName(), Query::Equals, msgCollection.id());
382 qCWarning(AKONADISERVER_LOG) << "NotificationCollector failed to query attributes for Collection" << collection.name() << "(ID"
407void NotificationCollector::tagNotification(Protocol::TagChangeNotification::Operation op, const Tag &tag, const QByteArray &resource, const QString &remoteId)
426 msgTag = HandlerHelper::fetchTagsResponse(Tag::retrieveById(msgTag.id()), fetchScope->toFetchScope(), mConnection);
442 qCWarning(AKONADISERVER_LOG) << "NotificationCollection failed to query attributes for Tag" << tag.id();
456void NotificationCollector::completeNotification(const Protocol::ChangeNotificationPtr &changeMsg)
463 qCWarning(AKONADISERVER_LOG) << "NotificationCollector requested FetchHelper from within a transaction."
495 ItemFetchHelper helper(mConnection, context, Scope(ids), itemFetchScope, tagFetchScope, mAkonadi);
506 qCWarning(AKONADISERVER_LOG) << "NotificationCollector railed to retrieve Items for notification!";
561 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:1010
bool inTransaction() const
Returns true if there is a transaction in progress.
Definition datastore.cpp:1411
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:155
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:90
void tagRemoved(const Tag &tag, const QByteArray &resource, const QString &remoteId)
Notify about a removed tag.
Definition notificationcollector.cpp:194
void itemsUnlinked(const PimItem::List &items, const Collection &collection)
Notify about unlinked items.
Definition notificationcollector.cpp:109
void collectionMoved(const Collection &collection, const Collection &source, const QByteArray &resource=QByteArray(), const QByteArray &destResource=QByteArray())
Notify about a moved collection.
Definition notificationcollector.cpp:140
bool dispatchNotifications()
Trigger sending of collected notifications.
Definition notificationcollector.cpp:544
void itemsTagsChanged(const PimItem::List &items, const QSet< qint64 > &addedTags, const QSet< qint64 > &removedTags, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about changed items tags.
Definition notificationcollector.cpp:72
NotificationCollector(AkonadiServer &akonadi, DataStore *db)
Create a new notification collector for the given DataStore db.
Definition notificationcollector.cpp:30
void collectionChanged(const Collection &collection, const QList< QByteArray > &changes, const QByteArray &resource=QByteArray())
Notify about a changed collection.
Definition notificationcollector.cpp:123
void setConnection(Connection *connection)
Sets the connection that is causing the changes.
Definition notificationcollector.cpp:204
void itemsLinked(const PimItem::List &items, const Collection &collection)
Notify about linked items.
Definition notificationcollector.cpp:104
void itemsRemoved(const PimItem::List &items, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about removed items.
Definition notificationcollector.cpp:99
void collectionUnsubscribed(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a collection unsubscription.
Definition notificationcollector.cpp:174
void collectionAdded(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a added collection.
Definition notificationcollector.cpp:114
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:59
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:53
void collectionSubscribed(const Collection &collection, const QByteArray &resource=QByteArray())
Notify about a collection subscription.
Definition notificationcollector.cpp:165
void itemAdded(const PimItem &item, bool seen, const Collection &collection=Collection(), const QByteArray &resource=QByteArray())
Notify about an added item.
Definition notificationcollector.cpp:46
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.
KIOCORE_EXPORT CopyJob * copy(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
bool isEmpty() 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)
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
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 Fri Nov 22 2024 12:03:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:03:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.