Skip to content

Commit

Permalink
fix for bug #95: add many tiffs in one turn - the last one is expande…
Browse files Browse the repository at this point in the history
…d, all the other are collapsed

git-svn-id: http://svn.osgeo.org/qgis/trunk@5497 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed May 29, 2006
1 parent 97a72e4 commit 32c9908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/gui/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,6 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en

// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);
layer->refreshLegend();

// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
#ifdef QGISDEBUG
Expand Down
13 changes: 6 additions & 7 deletions src/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,11 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
blockSignals(false);

layer->setLegend(this);
//QgsLegendPropertyGroup * lpgroup = new QgsLegendPropertyGroup(llayer,QString("Properties"));
layer->setLegendLayerFile(llfile);
layer->initContextMenu(mApp);

insertTopLevelItem(0, llayer);

setExpanded(indexFromItem(llayer), true);
setExpanded(indexFromItem(llfgroup), false);
setItemExpanded(llayer, true);
setItemExpanded(llfgroup, false);
//only if qsetting for 'legend layer file visible' is not set
if(!mShowLegendLayerFiles)
{
Expand All @@ -530,8 +527,10 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
// first layer?
if (mMapCanvas->layerCount() == 1)
mMapCanvas->zoomFullExtent();

setCurrentItem(llayer);
//make the QTreeWidget item up-to-date
doItemsLayout();
layer->refreshLegend();
}

QgsMapLayer* QgsLegend::currentLayer()
Expand Down Expand Up @@ -1384,7 +1383,7 @@ void QgsLegend::changeSymbologySettings(const QString& key, const std::list< std
//restore the current item again
setCurrentItem(theCurrentItem);
adjustIconSize();
setExpanded(indexFromItem(theLegendLayer), true);//make sure the symbology items are visible
setItemExpanded(theLegendLayer, true);//make sure the symbology items are visible
}

void QgsLegend::addPixmapWidthValue(int width)
Expand Down

0 comments on commit 32c9908

Please sign in to comment.