Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Slots | Public Member Functions | Private Attributes
CAAutoRecovery Class Reference

Class for making recovery files for application crashes. More...

#include <autorecovery.h>

Inheritance diagram for CAAutoRecovery:
Inheritance graph
[legend]

List of all members.

Public Slots

void cleanupRecovery ()
void saveRecovery ()

Public Member Functions

 CAAutoRecovery ()
 ~CAAutoRecovery ()
void updateTimer ()
void openRecovery ()

Private Attributes

QTimer * _autoRecoveryTimer
QTimer * _saveAfterRecoveryTimer

Detailed Description

Class for making recovery files for application crashes.

Copyright (c) 2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.

    Canorus creates recovery files in Canorus writeable settings directory for each currently
    opened document every number of minutes defined in CASettings.

    If the application is closed nicely, recovery files must be cleaned by calling
    cleanupRecovery() method.

    Otherwise Canorus looks for recovery files then next time it's executed and opens them
    automatically by calling openRecovery(). After recovering the files documents are marked
    as modified (so user needs to resave them, if closing the document by accident) and
    a special short-interval singleshot timer (see _saveAfterRecoveryInterval) is started
    to resave recovery files. This is usually needed when a user finds a bug, immediately
    repeats it and the autosave interval usually set to few minutes is not triggered yet.
    Recovery documents are not resaved immediately because Canorus might crash when recovering
    them (or soon after eg. mouse move) and is in unusable state until recovery files are
    manually deleted.

    Call saveRecovery() to save the currently opened documents to recovery files. The
    autosave timer's signal is connected to this slot.

    Settings class should already be initialized when creating instance of this class.

Constructor & Destructor Documentation

Initializes autosave. Reads the autosave timer settings from the CASettings class.

References _autoRecoveryTimer, saveRecovery(), and updateTimer().

Here is the call graph for this function:

References _autoRecoveryTimer.


Member Function Documentation

Deletes recovery files. This method is usually called when successfully quiting Canorus.

References CASettings::defaultSettingsPath().

Referenced by CACanorus::cleanUp(), openRecovery(), and saveRecovery().

Here is the call graph for this function:

Here is the caller graph for this function:

Searches for any not-cleaned up recovery files and opens them. Also shows the recovery message.

References _saveAfterRecoveryTimer, cleanupRecovery(), CADocument::dateLastModified(), CASettings::defaultSettingsPath(), CAImport::importDocument(), CAImport::importedDocument(), CACanorus::mainWinAt(), CACanorus::mainWinCount(), CAMainWin::openDocument(), saveRecovery(), CADocument::setModified(), CAFile::setStreamFromFile(), and CADocument::title().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Saves the currently opened documents into settings folder named recovery0, recovery1 etc.

References cleanupRecovery(), CASettings::defaultSettingsPath(), CAMainWin::document(), CAExport::exportDocument(), CACanorus::mainWinAt(), CACanorus::mainWinCount(), CAExport::setStreamToFile(), and CAExport::wait().

Referenced by CAAutoRecovery(), and openRecovery().

Here is the call graph for this function:

Here is the caller graph for this function:

Sets auto recovery interval to msec miliseconds.

References _autoRecoveryTimer, and CACanorus::settings().

Referenced by CASettingsDialog::applySettings(), and CAAutoRecovery().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Referenced by openRecovery().


The documentation for this class was generated from the following files: