Quark
0.1
|
A class to be used in implementing a document autosave feature. More...
#include <AutoSaver.h++>
Public Slots | |
void | changeOccurred () |
Notifies the AutoSaver that the document has changed. More... | |
void | saveIfNecessary () |
Performs a save operation, if the document changed since the last save. More... | |
Public Member Functions | |
AutoSaver (QObject *parent) | |
Constructs a new AutoSaver. More... | |
virtual | ~AutoSaver () |
Destructor. More... | |
void | setAutosaveInterval (int interval) |
Changes the autosave interval. More... | |
void | setMaxDelay (int delay) |
Changes the maximum autosave delay. More... | |
Static Public Attributes | |
static const int | DEFAULT_AUTOSAVE_INTERVAL |
The default autosave interval, in seconds. More... | |
static const int | MAX_DELAY |
The maximum delay, in seconds, before a save operation occurs. More... | |
Protected Member Functions | |
virtual void | timerEvent (QTimerEvent *event) |
A class to be used in implementing a document autosave feature.
The application invokes the changeOccurred() slot to indicates that the document has been modified by the user. The AutoSaver will automatically save the document after a specified interval (or after a maximum delay has passed) by invoking the save() slot of its parent object.
AutoSaver | ( | QObject * | parent | ) |
Constructs a new AutoSaver.
The | parent object. This object is expected to have a save() slot that takes no parameters. |
|
virtual |
Destructor.
|
slot |
Notifies the AutoSaver that the document has changed.
|
slot |
Performs a save operation, if the document changed since the last save.
void setAutosaveInterval | ( | int | interval | ) |
Changes the autosave interval.
Performs a save, if necessary, as a side-effect.
interval | The interval, in seconds. |
void setMaxDelay | ( | int | delay | ) |
Changes the maximum autosave delay.
Performs a save, if necessary, as a side-effect.
delay | The delay, in seconds. |
|
protectedvirtual |
|
static |
The default autosave interval, in seconds.
|
static |
The maximum delay, in seconds, before a save operation occurs.