Skip to content
Permalink
Browse files

Appied patch in ticket #811 from aaronr

git-svn-id: http://svn.osgeo.org/qgis/trunk@7416 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 16, 2007
1 parent b023826 commit bd3fd856a420881db25bc91c69ce2a840fbeceeb
Showing with 29 additions and 10 deletions.
  1. +11 −6 src/app/legend/qgslegendlayerfile.cpp
  2. +18 −4 src/gui/qgsmapcanvas.cpp
@@ -62,12 +62,17 @@ QgsLegendLayerFile::QgsLegendLayerFile(QTreeWidgetItem * theLegendItem, QString
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()));
}

@@ -247,16 +247,30 @@ void QgsMapCanvas::setLayerSet(QList<QgsMapCanvasLayer>& layers)
{
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()));
}
}
}

0 comments on commit bd3fd85

Please sign in to comment.
You can’t perform that action at this time.