Skip to content
Permalink
Browse files

fix #2314

git-svn-id: http://svn.osgeo.org/qgis/trunk@12593 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 23, 2009
1 parent 9a766a7 commit 79ced3947d967b5b21223bf4e14daa773c850d69
Showing with 6 additions and 16 deletions.
  1. +0 −8 src/app/legend/qgslegend.cpp
  2. +6 −8 src/app/legend/qgslegendlayer.cpp
@@ -537,14 +537,6 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
setCurrentItem( llayer );
//make the QTreeWidget item up-to-date
doItemsLayout();

// setup connections that will update the layer icons
if ( qobject_cast<QgsVectorLayer *>( layer ) )
{
QgsDebugMsg( "Connecting signals for updating icons, layer " + layer->name() );
connect( layer, SIGNAL( editingStarted() ), llayer, SLOT( updateIcon() ) );
connect( layer, SIGNAL( editingStopped() ), llayer, SLOT( updateIcon() ) );
}
}

QgsLegendLayer* QgsLegend::currentLegendLayer()
@@ -77,16 +77,14 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
// not in overview by default
mLyr.setInOverview( FALSE );

// Add check if vector layer when connecting to selectionChanged slot
// Ticket #811 - racicot
QgsMapLayer *currentLayer = mLyr.layer();
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
if ( isVectLyr )
// setup connections that will update the layer icons
if ( qobject_cast<QgsVectorLayer *>( layer ) )
{
connect( mLyr.layer(), SIGNAL( editingStarted() ), this, SLOT( updateLegendItem() ) );
connect( mLyr.layer(), SIGNAL( editingStopped() ), this, SLOT( updateLegendItem() ) );
QgsDebugMsg( "Connecting signals for updating icons, layer " + layer->name() );
connect( layer, SIGNAL( editingStarted() ), this, SLOT( updateIcon() ) );
connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
}
connect( mLyr.layer(), SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
}

QgsLegendLayer::~QgsLegendLayer()

0 comments on commit 79ced39

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