Skip to content

Commit

Permalink
Collapse raster symbology items by default, check for graystile raste…
Browse files Browse the repository at this point in the history
…r first and for raster shaders in a second part
  • Loading branch information
mhugent committed Jun 15, 2011
1 parent 4e78d8e commit 907f5c1
Show file tree
Hide file tree
Showing 2 changed files with 2,975 additions and 2,976 deletions.
13 changes: 5 additions & 8 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -709,7 +709,7 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
removeItem( cItem );
}

if( cItem )
if ( cItem )
{
group->insertChild( group->childCount(), cItem );
}
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
}


Expand Down
Loading

0 comments on commit 907f5c1

Please sign in to comment.