Skip to content

Commit

Permalink
Fix combo name in fielc calc bar
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 22, 2014
1 parent c234a09 commit d8f6fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -157,6 +157,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
mAttributeViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) );
mExpressionSelectButton->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionSelect.svg" ) );
mAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) );
mOpenExpressionWidget->setIcon( QgsApplication::getThemeIcon( "/mIconExpression.svg" ) );

// toggle editing
bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
Expand Down Expand Up @@ -203,7 +204,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid

mFieldModel = new QgsFieldModel();
mFieldModel->setLayer( mLayer );
mFieldComboButton->setModel( mFieldModel );
mFieldCombo->setModel( mFieldModel );
connect( mOpenExpressionWidget, SIGNAL( clicked() ), this, SLOT( openExpressionBuilder() ) );
connect( mRunFieldCalc, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpression() ) );
editingToggled();
Expand Down Expand Up @@ -294,7 +295,7 @@ void QgsAttributeTableDialog::updateFieldFromExpression()

mLayer->beginEditCommand( "Field calculator" );

QModelIndex modelindex = mFieldModel->indexFromName( mFieldComboButton->currentText() );
QModelIndex modelindex = mFieldModel->indexFromName( mFieldCombo->currentText() );
int fieldindex = modelindex.data( QgsFieldModel::FieldIndexRole ).toInt();

bool calculationSuccess = true;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsattributetabledialog.ui
Expand Up @@ -551,7 +551,7 @@
<number>1</number>
</property>
<item>
<widget class="QComboBox" name="mFieldComboButton"/>
<widget class="QComboBox" name="mFieldCombo"/>
</item>
<item>
<widget class="QLabel" name="label">
Expand Down

0 comments on commit d8f6fd0

Please sign in to comment.