Skip to content
Permalink
Browse files

Fix for bug #600 Renaming layer in legend doesn't stick

git-svn-id: http://svn.osgeo.org/qgis/trunk@6615 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Feb 17, 2007
1 parent d68b82e commit 2e85c7351a42d9756120f41c2eac135362f0df1f
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/app/legend/qgslegend.cpp
@@ -1456,6 +1456,16 @@ void QgsLegend::handleItemChange(QTreeWidgetItem* item, int row)
}

closePersistentEditor(item, row);
//if the text of a QgsLegendLayer has changed, change the display names of all its maplayers
QgsLegendLayer* theLegendLayer = dynamic_cast<QgsLegendLayer*>(item); //item is a legend layer
if(theLegendLayer)
{
std::list<QgsMapLayer*> theMapLayers = theLegendLayer->mapLayers();
for(std::list<QgsMapLayer*>::iterator it = theMapLayers.begin(); it != theMapLayers.end(); ++it)
{
(*it)->setLayerName(theLegendLayer->text(0));
}
}

std::map<QTreeWidgetItem*, Qt::CheckState>::iterator it = mStateOfCheckBoxes.find(item);
if (it == mStateOfCheckBoxes.end())

0 comments on commit 2e85c73

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