[Qgis-developer] Memory data provider persistence

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Dec 6 18:20:30 EST 2010


On Mon, Dec 6, 2010 at 7:12 PM, Chris Crook <ccrook at linz.govt.nz> wrote:
> Hi Barry et al
>
> Good point about a plugin implementation .. I hadn't thought of that obvious option - definitely one to follow up on.  It might still need a few tweaks in terms of Qgis.  The QgisInterface has a projectRead() signal that could be used to trigger reloading the data, but I don't see a projectSaved() signal to trigger writing.  Easy to add that though, and probably generally useful.

 There's a projectWrite signal:

http://www.qgis.org/api/classQgsProject.html#a935c811d84c51e908c73868be9b69c4

 which seems to be emitted before the layers are saved, so if anything
hooked into that wants to make changes it should be able to. Haven't
tried, but will that do the job?

> Given that there is a signal to hook in to this is, as you say, a piece of cake.  I'm kicking myself for not having thought of this months ago!!

 The only problem might be if the memory provider doesn't set the
project as dirty when it changes itself. Otherwise users could do a
'quit', and then qgis quits without chance to save the project.

> In terms of file location my preference would be something directly related to the project file .. That is obviously easy.  And shapefile is not my choice, just because of the messy bunch of files it creates and having so many of them and because the DBF format is limiting and pretty scungy!  But that is personal preference I guess.

 Agreed! I've been saving things as GML lately.

Barry


More information about the Qgis-developer mailing list