diff --git a/src/core/locator/qgslocatormodel.cpp b/src/core/locator/qgslocatormodel.cpp index ef946f829aa5..3002f7b4a2db 100644 --- a/src/core/locator/qgslocatormodel.cpp +++ b/src/core/locator/qgslocatormodel.cpp @@ -130,7 +130,7 @@ QVariant QgsLocatorModel::data( const QModelIndex &index, int role ) const switch ( static_cast( index.column() ) ) { case Name: - if ( !entry.filter ) + if ( entry.type == EntryType::Result ) { const QIcon &icon = entry.result.icon; if ( !icon.isNull() ) @@ -160,16 +160,10 @@ QVariant QgsLocatorModel::data( const QModelIndex &index, int role ) const return ( entry.result.score ); case static_cast< int >( CustomRole::ResultFilterPriority ): - if ( !entry.filter ) - return entry.result.filter->priority(); - else - return entry.filter->priority(); + return entry.filter->priority(); case static_cast< int >( CustomRole::ResultFilterName ): - if ( !entry.filter ) - return entry.result.filter->displayName(); - else - return entry.filterTitle; + return entry.filterTitle; case static_cast< int >( CustomRole::ResultFilterGroupTitle ): return entry.groupTitle;