![]() |
Mapper
0.9.0
API documentation
|
Class Autosave implements autosaving behaviour. More...
#include <autosave.h>
Public Types | |
enum | AutosaveResult { Success, PermanentFailure, TemporaryFailure } |
Possible results of autosave attempts. More... | |
Public Member Functions | |
virtual QString | autosavePath (const QString &path) const |
Returns the autosave file path for the given path. More... | |
virtual AutosaveResult | autosave ()=0 |
Performs an autosave, if possible. More... | |
void | setAutosaveNeeded (bool) |
Informs Autosave whether autosaving is needed or not. More... | |
bool | autosaveNeeded () const |
Returns true if autosave is known to be needed. More... | |
Protected Member Functions | |
Autosave () | |
Initializes the autosave feature. More... | |
virtual | ~Autosave () |
Destructs the autosave feature. More... | |
Friends | |
class | AutosavePrivate |
Class Autosave implements autosaving behaviour.
Autosaving means that data which has been modified is automatically saved after some period of time if no regular saving (typically triggered by the user) happens before.
Classes which wish to implement autosaving may inherit from this class. Inheriting classes must implement autosave(). Furthermore, they must call setAutosaveNeeded() when changes need to be taken care of by Autosave, or when normal saving has terminated the need to perform autosaving.
Autosaving, as implemented by autosave(), may succeed, fail temporarily (e.g. during editing), or fail permanently (e.g. for lack of disk space). On success or permanent failure, autosave() will be called again after the regular autosaving period. On temporary failure, autosave() will be called again after five seconds.
The autosave period (in minutes) is taken from the setting Settings::General_AutosaveInterval.
|
protected |
Initializes the autosave feature.
|
protectedvirtualdefault |
Destructs the autosave feature.
|
pure virtual |
Performs an autosave, if possible.
Implemented in AutosaveTestDocument.
bool OpenOrienteering::Autosave::autosaveNeeded | ( | ) | const |
Returns true if autosave is known to be needed.
Returns the autosave file path for the given path.
void OpenOrienteering::Autosave::setAutosaveNeeded | ( | bool | needed | ) |
Informs Autosave whether autosaving is needed or not.
|
friend |