Skip to content

Commit

Permalink
temporary fix for QgisIface::activeLayer()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4816 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Feb 10, 2006
1 parent 104d585 commit 6abf4ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -52,6 +52,7 @@
#include "qgsmaptopixel.h"
#include "qgsfield.h"
#include "qgsfeatureattribute.h"
#include "qgslegend.h"

extern "C" {
#include <gis.h>
Expand Down Expand Up @@ -86,7 +87,10 @@ QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
mCanvas = mIface->getMapCanvas();

// TODO QGIS: crash if canvas is empty
QgsMapLayer *layer = (QgsMapLayer *) mIface->activeLayer();

// At moment QgisIface::activeLayer() does not work
//QgsMapLayer *layer = (QgsMapLayer *) mIface->activeLayer();
QgsMapLayer *layer = (QgsMapLayer *) mCanvas->getLegend()->currentLayer();

if ( !layer ) {
std::cerr << "No layer is selected." << std::endl;
Expand Down

0 comments on commit 6abf4ef

Please sign in to comment.