Skip to content
Permalink
Browse files

Collapse raster symbology items by default, check for graystile raste…

…r first and for raster shaders in a second part
  • Loading branch information
mhugent committed Jun 15, 2011
1 parent 4e78d8e commit 907f5c1ce8f8b65692b1b1fcba2094b8c5f3d639
Showing with 2,975 additions and 2,976 deletions.
  1. +5 −8 src/app/legend/qgslegend.cpp
  2. +2,970 −2,968 src/core/raster/qgsrasterlayer.cpp
@@ -699,7 +699,7 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
QString layerId = childElem.firstChildElement( "filegroup" ).firstChildElement( "legendlayerfile" ).attribute( "layerid" );
QgsProject::instance()->createEmbeddedLayer( layerId, projectFilePath, brokenNodes, vectorLayerList, false );
QTreeWidgetItem* cItem = 0;
if( settings.value("/qgis/addNewLayersToCurrentGroup", false ).toBool() )
if ( settings.value( "/qgis/addNewLayersToCurrentGroup", false ).toBool() )
{
cItem = group->takeChild( 0 );
}
@@ -709,7 +709,7 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
removeItem( cItem );
}

if( cItem )
if ( cItem )
{
group->insertChild( group->childCount(), cItem );
}
@@ -776,8 +776,8 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
}

setItemExpanded( llayer, true );

refreshLayerSymbology( layer->id() );
//don't expand raster items by default, there could be too many
refreshLayerSymbology( layer->id(), layer->type() != QgsMapLayer::RasterLayer );

updateMapCanvasLayerSet();

@@ -1723,10 +1723,7 @@ void QgsLegend::refreshLayerSymbology( QString key, bool expandItem )
//restore the current item again
setCurrentIndex( currentItemIndex );
adjustIconSize();
if ( expandItem )
{
setItemExpanded( theLegendLayer, true );//make sure the symbology items are visible
}
setItemExpanded( theLegendLayer, expandItem );//make sure the symbology items are visible
}


0 comments on commit 907f5c1

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