From be1d1c6a1b43b8f124f4d59e462f3d30dc515b74 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Wed, 30 Oct 2024 11:51:24 +0100 Subject: [PATCH] fix missing icons in locator fixes #59243 --- src/core/locator/qgslocatormodel.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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;