Auto-Saving implemented in r16227 (to become 2.1.5) - Feedback wanted

Derek Atkins warlord at MIT.EDU
Tue Jul 3 13:50:30 EDT 2007


"Eric Ladner" <eric.ladner at> writes:

> Kind of like how 'vi' does it too.   Here's the rough logic...
> (on startup)
> if (alternate file exists)
>   // something went wrong..  prompt user for option of reloading saved
> checkpoint
>   if (user says yes)
>      load checkpoint
>   else
>      delete file
> (timed) save to alternate file
> if (user saves file)
>    delete checkpoint
> (on exit)
> if (not saved)
>    prompt user to save
>    if (user says yes)
>        save file
> delete checkpoint
> That way, you're not saving over the "official" data file, but saving to an
> alternate file that always has the same name (<account>.ckpt" maybe).  When
> loading account <account>, if a checkpoint exists, something bad happened
> and you can restore to that checkpoint, or just load the original file
> (rollback all the way to last session).

Unfortunately the way GnuCash/QOF works makes this sort of autosave
process very difficult to implement.  QOF tries to make it's data look
like a "database", not a "data file", so it really does abstract out
these things.


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list