Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some map tool connections, followup to 59a6663 and 6609ca8
  • Loading branch information
dakcarto committed Mar 20, 2014
1 parent 8b1d033 commit 5bc5fdb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/qgisapp.cpp
Expand Up @@ -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 )
Expand All @@ -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() ) );
}
}

Expand Down

5 comments on commit 5bc5fdb

@dakcarto
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NathanW2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@NathanW2 NathanW2 commented on 5bc5fdb Mar 20, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@3nids
Copy link
Member

@3nids 3nids commented on 5bc5fdb Mar 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakcarto you're right, I will rename them

Please sign in to comment.