Skip to content

Commit

Permalink
fix #2314
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12593 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 23, 2009
1 parent e49d300 commit 43563c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
8 changes: 0 additions & 8 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 6 additions & 8 deletions src/app/legend/qgslegendlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 43563c4

Please sign in to comment.