Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#811 closed defect (fixed)

selectionChanged() SIGNAL getting connected and disconnected on raster layers in qgsmapcanvas.cpp

Reported by: aaronr Owned by: aaronr
Priority: minor: annoyance Milestone:
Component: MapCanvas Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no


In qgsmapcanvas.cpp in QgsMapCanvas::setLayerSet a disconnect and connect call to selectionChanged signal are being made on the map layer set, but some of those layers can be raster layers. selectionChanged() is a signal that only vector layers can emit.

This bug causes warning messages to appear when calling setLayerSet via the python bindings with a layer set that contains rasters.

The solution is to wrap the disconnect and connect calls with logic to test if the layer is a vector layer.

Attachments (1)

bug811fix.diff (2.9 KB ) - added by aaronr 16 years ago.
Bug fix for Ticket #811

Download all attachments as: .zip

Change History (4)

by aaronr, 16 years ago

Attachment: bug811fix.diff added

Bug fix for Ticket #811

comment:1 by aaronr, 16 years ago

Status: newassigned

Turns out src/app/legend/qgslegendlayerfile.cpp also contains the issue... not only for selectionChanged() but for wasModified(bool) as well. Both of these need to be connected only to vector layers. Attached is a patch to wrap all of these cases to check for vector layer.

comment:2 by mhugent, 16 years ago

Resolution: fixed
Status: assignedclosed

Applied in r7416. Many thanks for the input!

comment:3 by (none), 14 years ago

Milestone: Version 0.9.1

Milestone Version 0.9.1 deleted

Note: See TracTickets for help on using tickets.