[Qgis-developer] Legend refactoring branch merged

Tim Sutton lists at linfiniti.com
Wed Jun 4 20:36:01 PDT 2014


Hi


On Thu, Jun 5, 2014 at 12:15 AM, Martin Dobias <wonder.sk at gmail.com> wrote:

> Hi Tim
>
> On Wed, Jun 4, 2014 at 11:06 PM, Tim Sutton <lists at linfiniti.com> wrote:
> > Hi
> >
> >
> > Another regression / change in behaviour between legend in 2.x and
> master is
> > that layers added in python are not focussed in the legend. This breaks
> some
> > of our InaSAFE stuff that expects this behaviour.
> >
> > Good:
> >
> >
> http://storage8.static.itmages.com/i/14/0604/h_1401898037_8549074_84a270face.png
> >
> > Bad:
> >
> >
> http://storage9.static.itmages.com/i/14/0604/h_1401898084_4943485_004d455ff0.png
>
> I think this behaviour can be added, but maybe it is not a good idea
> to rely on the fact that newly added layer is set as current. The
> behaviour wasn't documented anywhere, so it could be changed without
> any prior notice. Also, there could be various circumstances when this
> assumption may be wrong - e.g. plugins doing changes to the current
> layer. Finally, even in 2.2, if the user enables "Add new layers to
> selected or current group" and the selection is on a group, there will
> be no change of selection, so likely breaking that part of InaSAFE
> code too.
>
> Ok no worries, it is easily enough fixed by doing

iface.setActiveLayer(<layer>)

Thanks

Tim



> Martin
>



-- 
Tim Sutton - QGIS Project Steering Committee Member
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Irc: timlinux on #qgis at freenode.net
==============================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140605/421c00e8/attachment-0001.html>


More information about the Qgis-developer mailing list