[Qgis-developer] Feature: Auto saving for layers

Nathan Woodrow madmanwoo at gmail.com
Sat Sep 17 06:59:35 EDT 2011


Thanks for the feedback Barry.

I did have a look at your code when I started working on the auto save layer
thing.  I didn't take that approach as I didn't think relying on renderComplete
would work with saving layers.  In my mind I would like QGIS to check for a
auto save every N minutes even if I'm not pan or rendering a map, say I'm
setting up a tool or messing with the composer.  Or I leave my workstation
and forget to save (of course auto saving is not an excuse for being lazy
and not hitting the save button).

I am able to add a check in the timeout method that will check to see if the
layer is modified and if it's not then don't bother saving.   Could even
reset the timer for that layer if the person saves the layer manually. That
way we don't get a save check right after a manual save.

Thoughts?

- Nathan

On Sat, Sep 17, 2011 at 7:58 PM, Barry Rowlingson <
b.rowlingson at lancaster.ac.uk> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110917/252e22d6/attachment.html


More information about the Qgis-developer mailing list