[Qgis-developer] QgsMapLayerRegistry (and QgsMapCanvas) problem

Tim Sutton tim at linfiniti.com
Fri Nov 7 06:31:32 EST 2008


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....

Regards

Tim


-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Visit http://linfiniti.com to find out about:
 * QGIS programming services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list