[Qgis-developer] QgsMapLayerRegistry (and QgsMapCanvas) problem

Carson Farmer carson.farmer at gmail.com
Fri Nov 7 07:17:26 EST 2008

Tim Sutton wrote:
> Hi Martin
>>>> One thing I don't really like is that
>>>> QgsVectorDataProvider::reset() was renamed to begin(). The real
>>>> purpose of this function is to restart reading of the data, one
>>>> doesn't have to call it when starting retrieval of features - but
>>>> that's what the current name suggest. I would suggest using e.g.
>>>> resetReading() as it better corresponds with the action it takes (and
>>>> stays consistent with OGR).
>>> 1) The change to reset was done in consultation with Marco H. Calling
>>> reset sounds like its doing something damaging rather than moving to
>>> the start of the selection. Another option would be something like
>>> toSelectionStart() if you feel it would make its purpose clearer.
>> and what about seekToBegin() or resetReading() ?
>> begin() itself really doesn't make things clear.
> This is the last thing I need to resolve before we can freeze the core
> API (assuming Peter is finished his raster cleanups now). I had a poke
> around in the implementations of begin() in a couple of providers and
> I'm not really convinced that begin() is a bad choice for a method
> name or that seekToBegin() or resetReading() make things any clearer.
> In the case of e.g. the posgres provider, we move to the first record
> in the cursor, and reload the fields map. Ogr as you mentioned calls
> resetReading.  Grass moves to the first index position and refreshes
> the field index. I'd like to finalise this today so if you could give
> some additional thought to this it would be great. If I had to pick
> one of your options it would be seekToBegin() I guess. Not sure how
> others feel....
Despite the fact that I'm not actually a qgis developer, here is my two 

I know you're trying to avoid emulating the ogr api, but I think that 
something along the lines of resetReading() or restartReading() is 
better than begin(). You likely want something short, otherwise 
moveToSelectionStart() would be good. Since reset() has been rejected, 
what about restart()? This insinuates that we are moving to the 
beginning of the selection, but not that anything is being changed or reset.



Carson J. Q. Farmer
Doctoral Fellow
National Centre for Geocomputation (NCG),
John Hume Building,
National University of Ireland, Maynooth,
Co. Kildare,
Phone: +353 (0) 1 708 6726
Fax:   +353 (0) 1 708 6456
Email: Carson.Farmer at gmail.com
Web:   http://www.carsonfarmer.com/

More information about the Qgis-developer mailing list