[Qgis-developer] Feature: Auto saving for layers

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Sat Sep 17 05:58:51 EDT 2011


On Sat, Sep 17, 2011 at 6:10 AM, Nathan Woodrow <madmanwoo at gmail.com> wrote:
> Hi All,

>  After that a timer fires at the interval and saves the layer for you.  I
> thought a per-layer auto save feature is better then a blanket auto save for
> all as it gives the user more control.

 I wrote a plugin that autosaves projects (not layers) - instead of
firing a timer off I added a signal handler to the renderComplete
signal that checks to see if the project had been saved in the past N
minutes. If not, then the autosave happens.

 This means that the system isn't saving pointless changes every N
minutes if nothing has happened, and there's no possibility of
multiple timer events queueing up. It also means if the user has just
saved the project manually then the autosave doesn't bother doing it
again within N minutes.

Obviously it relies on renderComplete signals being emitted but these
happen every time you do almost anything that changes the project.

 Code is on google code for your perusal:
http://code.google.com/p/bsrplugins/source/browse/#svn%2Ftrunk%2Fautosave

 +1 for layer autosaves from me!

Barry


More information about the Qgis-developer mailing list