ChangeRecorder Class Reference
from PyKDE4.akonadi import *
Inherits: Akonadi.Monitor → QObject
Namespace: Akonadi
Detailed Description
Records and replays change notification.
This class is responsible for recording change notification 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.
Signals | |
changesAdded () | |
nothingToReplay () | |
Methods | |
__init__ (self, QObject parent=0) | |
changeProcessed (self) | |
QString | dumpNotificationListToString (self) |
bool | isEmpty (self) |
replayNext (self) | |
setChangeRecordingEnabled (self, bool enable) | |
setConfig (self, QSettings settings) |
Signal Documentation
changesAdded | ( | ) |
Emitted when new changes are recorded.
- Signal syntax:
QObject.connect(source, SIGNAL("changesAdded()"), target_slot)
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().
- Signal syntax:
QObject.connect(source, SIGNAL("nothingToReplay()"), target_slot)
Method Documentation
__init__ | ( | self, | ||
QObject | parent=0 | |||
) |
Creates a new change recorder.
changeProcessed | ( | self ) |
Removes the previously emitted change from the records.
QString dumpNotificationListToString | ( | self ) |
Debugging: dump current list of notifications, as saved on disk.
bool isEmpty | ( | self ) |
Returns whether there are recorded changes.
replayNext | ( | self ) |
Replay the next change notification and erase the previous one from the record.
setChangeRecordingEnabled | ( | self, | ||
bool | enable | |||
) |
Enables change recording. If change recording is disabled, this class behaves exactly like Akonadi.Monitor. Change recording is enabled by default.
setConfig | ( | self, | ||
QSettings | settings | |||
) |
Sets the QSettings object used for persistent recorded changes.