qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

Standardise accessors for current layer #14

Open nyalldawson opened 8 years ago

nyalldawson commented 8 years ago

A little thing, but this has always bothered me. In iface we have QgisInterface::activeLayer(), but for QgsMapCanvas we have QgsMapCanvas::currentLayer().

I always get these the wrong way around and try to call activeLayer on the canvas or currentLayer on the interface.

One of these names should be changed so that they are both equal. I'd suggest activeLayer is the better one to standardise on.

nyalldawson commented 7 years ago

Actually - currentLayer() is used in other places in the API. "active" is very infrequently used, so I think it activeLayer() should be renamed to currentLayer()

wonder-sk commented 7 years ago

+1 to "current" - it is more widely used term also in other parts of the API

rduivenvoorde commented 7 years ago

+1 see also https://lists.osgeo.org/pipermail/qgis-developer/2017-February/047236.html

m-kuhn commented 7 years ago

+1 for currentLayer()