Skip to content

Commit

Permalink
Fix for bug #600 Renaming layer in legend doesn't stick
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@6615 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 17, 2007
1 parent d68b82e commit 2e85c73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -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())
Expand Down

0 comments on commit 2e85c73

Please sign in to comment.