Akonadi::ChangeRecorder

Search for usage in LXR

Akonadi::ChangeRecorder Class Reference

#include <changerecorder.h>

Inheritance diagram for Akonadi::ChangeRecorder:

Signals

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 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 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 () override
 
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 ()
 
QList< Item::IditemsMonitoredEx () 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 ()
 
QList< Tag::Id > tagsMonitored () const
 
QList< TypetypesMonitored () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Public Types inherited from Akonadi::Monitor
enum  Type {
  Collections = 1 , Items , Tags , Subscribers ,
  Notifications
}
 
- Public Types inherited from QObject
typedef  QObjectList
 
- Properties inherited from QObject
 objectName
 
- 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 *context, Functor functor, 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)
 
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, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- 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.

Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g

Definition at line 34 of file changerecorder.h.

Constructor & Destructor Documentation

◆ ChangeRecorder()

ChangeRecorder::ChangeRecorder ( QObject * parent = nullptr)
explicit

Creates a new change recorder.

Definition at line 14 of file changerecorder.cpp.

◆ ~ChangeRecorder()

ChangeRecorder::~ChangeRecorder ( )
override

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

◆ changeProcessed()

void ChangeRecorder::changeProcessed ( )

Removes the previously emitted change from the records.

Definition at line 80 of file changerecorder.cpp.

◆ changesAdded

void Akonadi::ChangeRecorder::changesAdded ( )
signal

Emitted when new changes are recorded.

◆ dumpNotificationListToString()

QString Akonadi::ChangeRecorder::dumpNotificationListToString ( ) const
nodiscard

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

Definition at line 111 of file changerecorder.cpp.

◆ isEmpty()

bool ChangeRecorder::isEmpty ( ) const
nodiscard

Returns whether there are recorded changes.

Definition at line 74 of file changerecorder.cpp.

◆ nothingToReplay

void Akonadi::ChangeRecorder::nothingToReplay ( )
signal

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().

◆ replayNext

void ChangeRecorder::replayNext ( )
slot

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

Definition at line 43 of file changerecorder.cpp.

◆ setChangeRecordingEnabled()

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.

Parameters
enablefalse to disable change recording. true by default

Definition at line 96 of file changerecorder.cpp.

◆ setConfig()

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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.