Skip to content
Permalink
Browse files

Use correct field icon in form view preview menu

  • Loading branch information
nyalldawson committed Mar 8, 2016
1 parent f98b4ef commit ea10c5da3c23689cbc755b980c290dd79cd1836c
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/gui/attributetable/qgsdualview.cpp
@@ -108,17 +108,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();

@@ -169,7 +169,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 ea10c5d

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