diff --git a/src/core/locator/qgslocatormodel.cpp b/src/core/locator/qgslocatormodel.cpp index bde75a28c0e3..a77a8fea01b3 100644 --- a/src/core/locator/qgslocatormodel.cpp +++ b/src/core/locator/qgslocatormodel.cpp @@ -131,7 +131,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() ) @@ -161,16 +161,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;