Akonadi::ChangeRecorder Class Reference

#include <changerecorder.h>

Inheritance diagram for Akonadi::ChangeRecorder:


void changesAdded ()
void nothingToReplay ()
- Signals inherited from Akonadi::Monitor
void allMonitored (bool monitored)
void collectionAdded (const Akonadi::Collection &collection, const Akonadi::Collection &parent)
void collectionChanged (const Akonadi::Collection &collection)
void collectionChanged (const Akonadi::Collection &collection, const QSet< QByteArray > &attributeNames)
void collectionMonitored (const Akonadi::Collection &collection, bool monitored)
void collectionMoved (const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination)
void collectionRemoved (const Akonadi::Collection &collection)
void collectionStatisticsChanged (Akonadi::Collection::Id id, const Akonadi::CollectionStatistics &statistics)
void collectionSubscribed (const Akonadi::Collection &collection, const Akonadi::Collection &parent)
void collectionUnsubscribed (const Akonadi::Collection &collection)
void debugNotification (const Akonadi::ChangeNotification &notification)
void itemAdded (const Akonadi::Item &item, const Akonadi::Collection &collection)
void itemChanged (const Akonadi::Item &item, const QSet< QByteArray > &partIdentifiers)
void itemLinked (const Akonadi::Item &item, const Akonadi::Collection &collection)
void itemMonitored (const Akonadi::Item &item, bool monitored)
void itemMoved (const Akonadi::Item &item, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination)
void itemRemoved (const Akonadi::Item &item)
void itemsFlagsChanged (const Akonadi::Item::List &items, const QSet< QByteArray > &addedFlags, const QSet< QByteArray > &removedFlags)
void itemsLinked (const Akonadi::Item::List &items, const Akonadi::Collection &collection)
void itemsMoved (const Akonadi::Item::List &items, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination)
void itemsRelationsChanged (const Akonadi::Item::List &items, const Akonadi::Relation::List &addedRelations, const Akonadi::Relation::List &removedRelations)
void itemsRemoved (const Akonadi::Item::List &items)
void itemsTagsChanged (const Akonadi::Item::List &items, const QSet< Akonadi::Tag > &addedTags, const QSet< Akonadi::Tag > &removedTags)
void itemsUnlinked (const Akonadi::Item::List &items, const Akonadi::Collection &collection)
void itemUnlinked (const Akonadi::Item &item, const Akonadi::Collection &collection)
void mimeTypeMonitored (const QString &mimeType, bool monitored)
void monitorReady ()
void notificationSubscriberAdded (const Akonadi::NotificationSubscriber &subscriber)
void notificationSubscriberChanged (const Akonadi::NotificationSubscriber &subscriber)
void notificationSubscriberRemoved (const Akonadi::NotificationSubscriber &subscriber)
void relationAdded (const Akonadi::Relation &relation)
void relationRemoved (const Akonadi::Relation &relation)
void resourceMonitored (const QByteArray &identifier, bool monitored)
void tagAdded (const Akonadi::Tag &tag)
void tagChanged (const Akonadi::Tag &tag)
void tagMonitored (const Akonadi::Tag &tag, bool monitored)
void tagRemoved (const Akonadi::Tag &tag)
void typeMonitored (const Akonadi::Monitor::Type type, bool monitored)

Public Slots

void replayNext ()

Public Member Functions

 ChangeRecorder (QObject *parent=nullptr)
 ~ChangeRecorder ()
void changeProcessed ()
QString dumpNotificationListToString () const
bool isEmpty () const
void setChangeRecordingEnabled (bool enable)
void setConfig (QSettings *settings)
- Public Member Functions inherited from Akonadi::Monitor
 Monitor (QObject *parent=nullptr)
 ~Monitor () override
CollectionFetchScopecollectionFetchScope ()
Collection::List collectionsMonitored () const
bool exclusive () const
void fetchChangedOnly (bool enable)
void fetchCollection (bool enable)
void fetchCollectionStatistics (bool enable)
void ignoreSession (Session *session)
bool isAllMonitored () const
ItemFetchScopeitemFetchScope ()
QVector< Item::Id > itemsMonitoredEx () const
QStringList mimeTypesMonitored () const
int numItemsMonitored () const
int numMimeTypesMonitored () const
int numResourcesMonitored () const
QList< QByteArrayresourcesMonitored () const
Sessionsession () const
void setAllMonitored (bool monitored=true)
void setCollectionFetchScope (const CollectionFetchScope &fetchScope)
void setCollectionMonitored (const Collection &collection, bool monitored=true)
void setCollectionMoveTranslationEnabled (bool enabled)
void setExclusive (bool exclusive=true)
void setItemFetchScope (const ItemFetchScope &fetchScope)
void setItemMonitored (const Item &item, bool monitored=true)
void setMimeTypeMonitored (const QString &mimetype, bool monitored=true)
void setResourceMonitored (const QByteArray &resource, bool monitored=true)
void setSession (Akonadi::Session *session)
void setTagFetchScope (const TagFetchScope &fetchScope)
void setTagMonitored (const Tag &tag, bool monitored=true)
void setTypeMonitored (Type type, bool monitored=true)
TagFetchScopetagFetchScope ()
QVector< Tag::Id > tagsMonitored () const
QVector< TypetypesMonitored () const
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
bool blockSignals (bool block)
const QObjectListchildren () const const
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
void deleteLater ()
void destroyed (QObject *obj)
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
bool disconnect (const QObject *receiver, const char *method) const const
void dumpObjectInfo ()
void dumpObjectInfo () const const
void dumpObjectTree ()
void dumpObjectTree () const const
QList< QByteArraydynamicPropertyNames () const const
virtual bool event (QEvent *e)
virtual bool eventFilter (QObject *watched, QEvent *event)
findChild (const QString &name, Qt::FindChildOptions options) const const
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
bool inherits (const char *className) const const
void installEventFilter (QObject *filterObj)
bool isWidgetType () const const
bool isWindowType () const const
void killTimer (int id)
virtual const QMetaObjectmetaObject () const const
void moveToThread (QThread *targetThread)
QString objectName () const const
void objectNameChanged (const QString &objectName)
QObjectparent () const const
QVariant property (const char *name) const const
 Q_CLASSINFO (Name, Value)
 Q_ENUM (...)
 Q_ENUM_NS (...)
 Q_ENUMS (...)
 Q_FLAG (...)
 Q_FLAG_NS (...)
 Q_FLAGS (...)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
qobject_cast (QObject *object)
qobject_cast (const QObject *object)
void removeEventFilter (QObject *obj)
void setObjectName (const QString &name)
void setParent (QObject *parent)
bool setProperty (const char *name, const QVariant &value)
bool signalsBlocked () const const
int startTimer (int interval, Qt::TimerType timerType)
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
QThreadthread () const const

Additional Inherited Members

- Public Types inherited from Akonadi::Monitor
enum  Type {
  Collections = 1, Items, Tags, Relations,
  Subscribers, Notifications
- Properties inherited from QObject
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
bool disconnect (const QMetaObject::Connection &connection)
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
QString tr (const char *sourceText, const char *disambiguation, int n)
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
- Public Attributes inherited from QObject
typedef QObjectList
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
virtual void connectNotify (const QMetaMethod &signal)
virtual void customEvent (QEvent *event)
virtual void disconnectNotify (const QMetaMethod &signal)
bool isSignalConnected (const QMetaMethod &signal) const const
int receivers (const char *signal) const const
QObjectsender () const const
int senderSignalIndex () const const
virtual void timerEvent (QTimerEvent *event)

Detailed Description

Records and replays change notification.

This class is responsible for recording change notifications while an agent is not online and replaying the notifications when the agent is online again. Therefore the agent doesn't have to care about online/offline mode in its synchronization algorithm.

Unlike Akonadi::Monitor this class only emits one change signal at a time. To receive the next one you need to explicitly call replayNext(). If a signal is emitted that has no receivers, it's automatically skipped, which means you only need to connect to signals you are actually interested in.

Volker Krause vkrau[email protected][email protected][email protected]de.or[email protected]g

Definition at line 36 of file changerecorder.h.

Constructor & Destructor Documentation

ChangeRecorder::ChangeRecorder ( QObject parent = nullptr)

Creates a new change recorder.

Definition at line 14 of file changerecorder.cpp.

ChangeRecorder::~ChangeRecorder ( )

Destroys the change recorder.

All not yet processed changes are written back to the config file.

Definition at line 24 of file changerecorder.cpp.

Member Function Documentation

void ChangeRecorder::changeProcessed ( )

Removes the previously emitted change from the records.

Definition at line 80 of file changerecorder.cpp.

void Akonadi::ChangeRecorder::changesAdded ( )

Emitted when new changes are recorded.

QString Akonadi::ChangeRecorder::dumpNotificationListToString ( ) const

Debugging: dump current list of notifications, as saved on disk.

Definition at line 111 of file changerecorder.cpp.

bool ChangeRecorder::isEmpty ( ) const

Returns whether there are recorded changes.

Definition at line 74 of file changerecorder.cpp.

void Akonadi::ChangeRecorder::nothingToReplay ( )

Emitted when replayNext() was called, but there was no valid change to replay.

This can happen when all pending changes have been filtered out, for example. You only need to connect to this signal if you rely on one signal being emitted as a result of calling replayNext().

void ChangeRecorder::replayNext ( )

Replay the next change notification and erase the previous one from the record.

Definition at line 43 of file changerecorder.cpp.

void ChangeRecorder::setChangeRecordingEnabled ( bool  enable)

Enables change recording.

If change recording is disabled, this class behaves exactly like Akonadi::Monitor. Change recording is enabled by default.

enablefalse to disable change recording. true by default

Definition at line 96 of file changerecorder.cpp.

void ChangeRecorder::setConfig ( QSettings settings)

Sets the QSettings object used for persistent recorded changes.

Definition at line 28 of file changerecorder.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 23:15:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.