From f0a7b6367be83820ab00ac1c34d6ca2409983861 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 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;