Skip to content

Commit

Permalink
fix #3859
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 1, 2011
1 parent df8bd2d commit edad445
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/plugins/grass/qgsgrassedit.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1813,8 +1813,6 @@ void QgsGrassEdit::displayDynamic( struct line_pnts *Points, double x, double y,


void QgsGrassEdit::displayNode( int node, const QPen & pen, int size, QPainter *painter ) void QgsGrassEdit::displayNode( int node, const QPen & pen, int size, QPainter *painter )
{ {
QgsDebugMsg( QString( "node = %1" ).arg( node ) );

if ( !mSymbDisplay[mNodeSymb[node]] ) if ( !mSymbDisplay[mNodeSymb[node]] )
return; return;


Expand All @@ -1840,8 +1838,6 @@ QgsPoint QgsGrassEdit::transformLayerToMap( QgsPoint point )
void QgsGrassEdit::displayIcon( double x, double y, const QPen & pen, void QgsGrassEdit::displayIcon( double x, double y, const QPen & pen,
int type, int size, QPainter *painter ) int type, int size, QPainter *painter )
{ {
QgsDebugMsg( "entered." );

QgsPoint point; QgsPoint point;
QPolygon pointArray( 2 ); QPolygon pointArray( 2 );


Expand Down
7 changes: 7 additions & 0 deletions src/plugins/grass/qgsgrassplugin.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ void QgsGrassPlugin::edit()
mCanvas->refresh(); mCanvas->refresh();
connect( mEdit, SIGNAL( finished() ), this, SLOT( setEditAction() ) ); connect( mEdit, SIGNAL( finished() ), this, SLOT( setEditAction() ) );
connect( mEdit, SIGNAL( finished() ), this, SLOT( cleanUp() ) ); connect( mEdit, SIGNAL( finished() ), this, SLOT( cleanUp() ) );
connect( mEdit, SIGNAL( destroyed() ), this, SLOT( editClosed() ) );
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) ); connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) );
} }
else else
Expand Down Expand Up @@ -488,6 +489,12 @@ void QgsGrassPlugin::closeEdit( QString layerId )
} }
} }


void QgsGrassPlugin::editClosed()
{
if( mEdit == sender() )
mEdit = 0;
}

void QgsGrassPlugin::cleanUp() void QgsGrassPlugin::cleanUp()
{ {
disconnect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) ); disconnect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( closeEdit( QString ) ) );
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrassplugin.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class QgsGrassPlugin : public QObject, public QgisPlugin
//! update plugin icons when the app tells us its theme is changed //! update plugin icons when the app tells us its theme is changed
void setCurrentTheme( QString theThemeName ); void setCurrentTheme( QString theThemeName );
void setTransform(); void setTransform();
void editClosed();
private: private:
//! Name of the plugin //! Name of the plugin
QString pluginNameQString; QString pluginNameQString;
Expand Down

0 comments on commit edad445

Please sign in to comment.