Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1932 from ccrook/Field_calculator_expression_fix
Fix #12257 - allow creation of expression field on delimited text layer
  • Loading branch information
NathanW2 committed Mar 29, 2015
2 parents 1cce091 + 9c2f572 commit 5f1ed35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsfieldcalculator.cpp
Expand Up @@ -158,7 +158,11 @@ void QgsFieldCalculator::accept()
return;
}

if ( mNewFieldGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
// Test for creating expression field based on ! mUpdateExistingGroupBox checked rather
// than on mNewFieldGroupBox checked, as if the provider does not support adding attributes
// then mUpdateExistingGroupBox is set to not checkable, and hence is not checked. This
// is a minimum fix to resolve this - better would be some GUI redesign...
if ( ! mUpdateExistingGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
{
mVectorLayer->addExpressionField( calcString, fieldDefinition() );
}
Expand Down

0 comments on commit 5f1ed35

Please sign in to comment.