[Qgis-developer] Proposed plan to fix issue with concurrent opening of OGR datasources (aka QGIS and MapInfo)

Even Rouault even.rouault at spatialys.com
Tue Mar 22 03:27:35 PDT 2016

> > - go back to read-only mode when the user exists the edition mode (this
> > would need a new method in the QgsVectorDataProvider API to warn about
> > that, since the provider has currently no way of knowing that)
> Thank you for taking care of that.
> Could you elaborate on the last item ? Does it mean adding something
> like beginEdit() / endEdit() on QgsVectorDataProvider ?


> Is it an API break 

API extension I'd say. The default implementation would be {}.

> and if not how does it work for existing code that
> does not call begin/end edit ?

From what I can see in QgsVectorLayer, you cannot call addFeature(), 
addFeatures(), changeAttributeValue(), deleteFeature(), deleteFeatures(), 
etc.. if there's no mEditBuffer active. And the only way to have one active is 
to call startEditing() before. So unless I'm missing something, it doesn't 
look like you can do changes to a dataset without doing them between 
startEditing() and commitChanges()/rollBack()

Spatialys - Geospatial professional services

More information about the Qgis-developer mailing list