On 03/22/2016 01:44 PM, Hugo Mercier wrote: > > On 22/03/2016 12:11, Even Rouault wrote: > >>>> True. >>>> But you can also directly access the provider update methods without >>>> edit buffers and without startEditing / commitChanges. >>> Good point. I didn't think at that use case of direct access to the >>> provider API. >>> >>>> ... but after all ... if I understood correctly your intents, for >>>> existing codes that use this direct provider access, update functions >>>> will reopen the source in write mode and they will always stay in that >>>> mode because the endEdit() method will never be called ? >>> Yes. >>> >>> One possibility would be also to go back to read-only mode with a timer. >>> For a write operation, outside of beginEdit() / endEdit(), that lead to >>> re-opening in update-mode, after X seconds without write activity, the >>> dataset would be re-opened in update mode. >> correction: "...would be re-opened in *read-only* mode" >> > I am not sure to like this timeout ... I prefer when the state of > objects does not silently change in background :) > Doing nothing would be ok: existing (plugin) codes would lock under > windows, which is already the case, and would have the opportunity to be > safer by calling endEdit().
What about adding the re-open file code at the beginning and end of the dataprovider functions (QgsOgrProvider::addFeatures etc.)? If we're afraid that there is too little control this way, we could still add a controlled "update state" to the provider and in case this is already set, the re-opening will be skipped. Matthias > _______________________________________________ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Matthias Kuhn OPENGIS.ch - https://www.opengis.ch Spatial • (Q)GIS • PostGIS • Open Source
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer