Index: src/app/legend/qgslegendlayerfile.cpp =================================================================== --- src/app/legend/qgslegendlayerfile.cpp (revision 7413) +++ src/app/legend/qgslegendlayerfile.cpp (working copy) @@ -62,12 +62,17 @@ setCheckState(0, Qt::Checked); setText(0, theString); - // get notifications of changed selection - used to update attribute table - connect(mLyr.layer(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); - - // get notifications of modified layer - used to close table as it's out of sync - connect(mLyr.layer(), SIGNAL(wasModified(bool)), this, SLOT(closeTable(bool))); - + // Add check if vector layer when connecting to selectionChanged slot + // Ticket #811 - racicot + QgsMapLayer *currentLayer = mLyr.layer(); + QgsVectorLayer *isVectLyr = dynamic_cast < QgsVectorLayer * >(currentLayer); + if (isVectLyr) + { + // get notifications of changed selection - used to update attribute table + connect(mLyr.layer(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); + // get notifications of modified layer - used to close table as it's out of sync + connect(mLyr.layer(), SIGNAL(wasModified(bool)), this, SLOT(closeTable(bool))); + } connect(mLyr.layer(), SIGNAL(layerNameChanged()), this, SLOT(layerNameChanged())); } Index: src/gui/qgsmapcanvas.cpp =================================================================== --- src/gui/qgsmapcanvas.cpp (revision 7413) +++ src/gui/qgsmapcanvas.cpp (working copy) @@ -247,16 +247,30 @@ { for (i = 0; i < layerCount(); i++) { - disconnect(getZpos(i), SIGNAL(repaintRequested()), this, SLOT(refresh())); - disconnect(getZpos(i), SIGNAL(selectionChanged()), this, SLOT(refresh())); + // Add check if vector layer when disconnecting from selectionChanged slot + // Ticket #811 - racicot + QgsMapLayer *currentLayer = getZpos(i); + disconnect(currentLayer, SIGNAL(repaintRequested()), this, SLOT(refresh())); + QgsVectorLayer *isVectLyr = dynamic_cast < QgsVectorLayer * >(currentLayer); + if (isVectLyr) + { + disconnect(currentLayer, SIGNAL(selectionChanged()), this, SLOT(refresh())); + } } mMapRender->setLayerSet(layerSet); for (i = 0; i < layerCount(); i++) { - connect(getZpos(i), SIGNAL(repaintRequested()), this, SLOT(refresh())); - connect(getZpos(i), SIGNAL(selectionChanged()), this, SLOT(refresh())); + // Add check if vector layer when connecting to selectionChanged slot + // Ticket #811 - racicot + QgsMapLayer *currentLayer = getZpos(i); + connect(currentLayer, SIGNAL(repaintRequested()), this, SLOT(refresh())); + QgsVectorLayer *isVectLyr = dynamic_cast < QgsVectorLayer * >(currentLayer); + if (isVectLyr) + { + connect(currentLayer, SIGNAL(selectionChanged()), this, SLOT(refresh())); + } } }