#62 autosave that works with multiple instances

Unstable_(example)
closed
nobody
None
5
2014-06-30
2010-11-29
Timo Kluck
No

This patch is a modification of the work done by aiwarrior and mr Yang. It has some more logic for deciding on where to save autosaves, and keeps track of other running instances of Xournal (without trying to 'restore' their current autosaves).

Autosaves are now stored "along side" the .xoj file, with a .xoj.autosave~ suffix. If the file has no filename yet, an autosave is made in the user's homedir. Additionally, a table of all running xournal instances, together with their autosave filenames, is maintained in ~/.xournal/autosaves. On startup, xournal checks if any of these table entries have been 'orphaned' and prompts the user before restoring.

Furthermore, when opening a file, xournal checks if there exists a corresponding .autosave~ file, and restores it if it is newer.

Applies against Xournal 0.4.5.

Discussion

  • Timo Kluck
    Timo Kluck
    2010-12-15

    Just uploaded two very minor modifications: quote the filenames on a commandline, and removed unnecessary debug output.

     
  • Timo Kluck
    Timo Kluck
    2011-03-13

    autosave multiple instances patch (v3)

     
  • Timo Kluck
    Timo Kluck
    2011-03-13

    New version (v3) fixes a bug where a new empty journal's autosave would overwrite an older autosave.

     
  • Here is an updated patch (v4) that applies against 0.4.7.

     
  • Denis Auroux
    Denis Auroux
    2014-06-30

    Xournal 0.4.8 has an autosave feature -- implemented a bit differently; the autosave files are stored alongside the xoj or pdf files being edited, named filename.xoj.autosaveN.xoj (N=0 to 9).

    Xournal 0.4.8 only checks for auto-saves corresponding to the file that you are opening. Also, there is no careful attempt to detect whether autosaves correspond to running instances (the code in the multiple-instances version of this patch is not portable to win32 and uses more external commands than I am comfortable with), so if you open a same document twice the second instance may ask you whether to restore an auto-save -- but the default choice is "ignore". Also, the user can just directly open the .autosave.xoj file rather than run a recovery if they prefer.

    I'll close this patch, since having multiple incompatible auto-save features is not desirable. Please open bug reports if you find problems with the "official" auto-save implementation.

    Denis

     
  • Denis Auroux
    Denis Auroux
    2014-06-30

    • status: open --> closed
    • Group: --> Unstable_(example)