Skip to content
Permalink
Browse files

Use correct field icon in form view preview menu

(cherry-pick from ea10c5d)
  • Loading branch information
nyalldawson committed Mar 9, 2016
1 parent 29bf95c commit ea960182780611ee6b0bb85555148fc5617407c1
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/gui/attributetable/qgsdualview.cpp
@@ -107,17 +107,17 @@ void QgsDualView::columnBoxInit()
QString displayExpression = mLayerCache->layer()->displayExpression();

// if no display expression is saved: use display field instead
if ( displayExpression == "" )
if ( displayExpression.isEmpty() )
{
if ( mLayerCache->layer()->displayField() != "" )
if ( !mLayerCache->layer()->displayField().isEmpty() )
{
defaultField = mLayerCache->layer()->displayField();
displayExpression = QString( "COALESCE(\"%1\", '<NULL>')" ).arg( defaultField );
}
}

// if neither diaplay expression nor display field is saved...
if ( displayExpression == "" )
// if neither display expression nor display field is saved...
if ( displayExpression.isEmpty() )
{
QgsAttributeList pkAttrs = mLayerCache->layer()->pkAttributeList();

@@ -168,7 +168,7 @@ void QgsDualView::columnBoxInit()

if ( mLayerCache->layer()->editFormConfig()->widgetType( fieldIndex ) != "Hidden" )
{
QIcon icon = QgsApplication::getThemeIcon( "/mActionNewAttribute.png" );
QIcon icon = mLayerCache->layer()->fields().iconForField( fieldIndex );
QString text = field.name();

// Generate action for the preview popup button of the feature list

0 comments on commit ea96018

Please sign in to comment.
You can’t perform that action at this time.