Skip to content
Permalink
Browse files

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 5f1ed3582d9b549822b7110336de5c745790c189
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/app/qgsfieldcalculator.cpp
@@ -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() );
}

0 comments on commit 5f1ed35

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