Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use correct field icon in form view preview menu
  • Loading branch information
nyalldawson committed Mar 8, 2016
1 parent f98b4ef commit ea10c5d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ea10c5d

Please sign in to comment.