Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when using select by expression from attribute table dialog
(cherry picked from commit 00c4d4a)
  • Loading branch information
nyalldawson committed Jan 17, 2019
1 parent 8127c70 commit 3edf0f6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/qgsexpressionselectiondialog.cpp
Expand Up @@ -134,19 +134,23 @@ void QgsExpressionSelectionDialog::mActionRemoveFromSelection_triggered()

void QgsExpressionSelectionDialog::pushSelectedFeaturesMessage()
{
int count = mLayer->selectedFeatureCount();
if ( !mMessageBar )
return;

const int timeout = QgsSettings().value( QStringLiteral( "qgis/messageTimeout" ), 5 ).toInt();
const int count = mLayer->selectedFeatureCount();
if ( count > 0 )
{
mMessageBar->pushMessage( QString(),
tr( "%1 matching %2 selected" ).arg( count )
.arg( count == 1 ? tr( "feature" ) : tr( "features" ) ),
Qgis::Info );
Qgis::Info, timeout );
}
else
{
mMessageBar->pushMessage( QString(),
tr( "No matching features found" ),
Qgis::Warning );
Qgis::Warning, timeout );
}
}

Expand Down

0 comments on commit 3edf0f6

Please sign in to comment.