Skip to content
Permalink
Browse files

Fix some map tool connections, followup to 59a6663 and 6609ca8

  • Loading branch information
dakcarto committed Mar 20, 2014
1 parent 8b1d033 commit 5bc5fdb98724a8c7ff9eb7fe2dacd5b6f2e740d2
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/app/qgisapp.cpp
@@ -8026,9 +8026,9 @@ void QgisApp::mapToolChanged( QgsMapTool *newTool, QgsMapTool *oldTool )
{
if ( oldTool )
{
disconnect( oldTool, SIGNAL( displayMessage( QString ) ), this, SLOT( displayMapToolMessage( QString ) ) );
disconnect( oldTool, SIGNAL( displayMessage( QString, QgsMessageBar::MessageLevel ) ), this, SLOT( displayMapToolMessage( QString, QgsMessageBar::MessageLevel ) ) );
disconnect( oldTool, SIGNAL( removeMessage() ), this, SLOT( removeMapToolMessage() ) );
disconnect( oldTool, SIGNAL( emitMessage( QString ) ), this, SLOT( displayMapToolMessage( QString ) ) );
disconnect( oldTool, SIGNAL( emitMessage( QString, QgsMessageBar::MessageLevel ) ), this, SLOT( displayMapToolMessage( QString, QgsMessageBar::MessageLevel ) ) );
disconnect( oldTool, SIGNAL( discardMessage() ), this, SLOT( removeMapToolMessage() ) );
}

if ( newTool )
@@ -8038,9 +8038,9 @@ void QgisApp::mapToolChanged( QgsMapTool *newTool, QgsMapTool *oldTool )
mNonEditMapTool = newTool;
}

connect( newTool, SIGNAL( displayMessage( QString ) ), this, SLOT( displayMapToolMessage( QString ) ) );
connect( newTool, SIGNAL( displayMessage( QString, QgsMessageBar::MessageLevel ) ), this, SLOT( displayMapToolMessage( QString, QgsMessageBar::MessageLevel ) ) );
connect( newTool, SIGNAL( removeMessage() ), this, SLOT( removeMapToolMessage() ) );
connect( newTool, SIGNAL( emitMessage( QString ) ), this, SLOT( displayMapToolMessage( QString ) ) );
connect( newTool, SIGNAL( emitMessage( QString, QgsMessageBar::MessageLevel ) ), this, SLOT( displayMapToolMessage( QString, QgsMessageBar::MessageLevel ) ) );
connect( newTool, SIGNAL( discardMessage() ), this, SLOT( removeMapToolMessage() ) );
}
}

5 comments on commit 5bc5fdb

@dakcarto

This comment has been minimized.

Copy link
Member Author

@dakcarto dakcarto replied Mar 20, 2014

@3nids Curious why the signal signatures needed changed? I don't see (or maybe just don't understand) the advantage.

@NathanW2

This comment has been minimized.

Copy link
Member

@NathanW2 NathanW2 replied Mar 20, 2014

displayMessage implies that it will be shown to the user, where as it may not depending on who is listening. In this case QGisApp will show the message but that might change in the future. I just think it's more correct in terms of API.

@dakcarto

This comment has been minimized.

Copy link
Member Author

@dakcarto dakcarto replied Mar 20, 2014

Ok. In that case, then a Qt-type signal wording might be best, e.g. messageEmitted and messageDiscarded, no? Represents the action that took place.

@NathanW2

This comment has been minimized.

Copy link
Member

@NathanW2 NathanW2 replied Mar 20, 2014

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids replied Mar 21, 2014

@dakcarto you're right, I will rename them

Please sign in to comment.
You can’t perform that action at this time.