Skip to content

Commit

Permalink
disconnect signals, check mValid in postRender, set newpoint on startup
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4921 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Feb 28, 2006
1 parent 63a2c9c commit fc3bfde
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -454,6 +454,7 @@ void QgsGrassEdit::init()
// TODO: how to get keyboard events from canvas (shortcuts)

mNewPointAction->setOn(true); // Start NEW_POINT tool
startTool(QgsGrassEdit::NEW_POINT);

restorePosition();

Expand Down Expand Up @@ -842,6 +843,15 @@ void QgsGrassEdit::closeEdit(void)
std::cerr << "QgsGrassEdit::close()" << std::endl;
#endif

// Disconnect signals
// Warning: it seems that slots (postRender) can be called even
// after disconnect (is it a queue?)
disconnect( this, SLOT(mouseEventReceiverClick(QgsPoint &, Qt::ButtonState)));
disconnect( this, SLOT(mouseEventReceiverMove(QgsPoint &)));
disconnect( this, SLOT(postRender(QPainter *)));

mValid = false; // important for postRender

if ( mAttributes ) {
delete mAttributes;
}
Expand Down Expand Up @@ -1908,6 +1918,12 @@ void QgsGrassEdit::postRender(QPainter *painter)
std::cerr << "QgsGrassEdit::postRender" << std::endl;
#endif

// Warning: it seems that this slot can be called even
// after disconnect (is it a queue?)
// -> check mValid

if ( !mValid ) return;

displayMap(painter);

// Redisplay highlighted
Expand Down

0 comments on commit fc3bfde

Please sign in to comment.