Skip to content

Commit c7d4398

Browse files
author
wonder
committedApr 3, 2006
Fixed ticket #37 - remove layer from toolbar didn't work correctly
git-svn-id: http://svn.osgeo.org/qgis/trunk@5146 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1c0b234 commit c7d4398

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed
 

‎src/gui/qgisapp.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,34 +3574,7 @@ void QgisApp::inOverview()
35743574

35753575
void QgisApp::removeLayer()
35763576
{
3577-
#ifdef QGISDEBUG
3578-
std::cout << "QGisApp Removing layer" << std::endl;
3579-
#endif
3580-
//make sure canvase is not rendering first by faking an escape keypress
3581-
emit keyPressEvent(new QKeyEvent(QEvent::KeyPress ,Qt::Key_Escape,Qt::Key_Escape,0 ));
3582-
mMapCanvas->freeze();
3583-
QTreeWidgetItem *lvi = mMapLegend->currentItem();
3584-
if(lvi)
3585-
{
3586-
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>(lvi);
3587-
QgsLegendLayer* ll = dynamic_cast<QgsLegendLayer*>(lvi);
3588-
if(llf)
3589-
{
3590-
QgsMapLayer *layer = llf->layer();
3591-
//call the registry to unregister the layer. It will in turn
3592-
//fire a qt signal to notify any objects using that layer that they should
3593-
//remove it immediately
3594-
QgsMapLayerRegistry::instance()->removeMapLayer(layer->getLayerID());
3595-
mMapCanvas->freeze(false);
3596-
3597-
// draw the map
3598-
mMapCanvas->refresh();
3599-
}
3600-
else if(ll)
3601-
{
3602-
mMapLegend->legendLayerRemove();
3603-
}
3604-
}
3577+
mMapLegend->legendLayerRemove();
36053578
}
36063579

36073580

0 commit comments

Comments
 (0)
Please sign in to comment.