Skip to content

Commit

Permalink
Fix clearing constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and m-kuhn committed Nov 16, 2016
1 parent 747097d commit 95271c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgsfieldsproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,14 +1001,26 @@ void QgsFieldsProperties::apply()
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintNotNull, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintUnique )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintUnique, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintUnique, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintUnique );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintExpression )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintExpression, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintExpression, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintExpression );
}

if ( mFieldsList->item( i, attrWMSCol )->checkState() == Qt::Unchecked )
{
Expand Down

0 comments on commit 95271c8

Please sign in to comment.