File tree Expand file tree Collapse file tree 1 file changed +1
-28
lines changed Expand file tree Collapse file tree 1 file changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -3574,34 +3574,7 @@ void QgisApp::inOverview()
3574
3574
3575
3575
void QgisApp::removeLayer ()
3576
3576
{
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 ();
3605
3578
}
3606
3579
3607
3580
You can’t perform that action at this time.
0 commit comments