Skip to content
Permalink
Browse files

fix working on constraints when field list sorted

  • Loading branch information
tudorbarascu authored and m-kuhn committed Jan 25, 2017
1 parent a49fc8a commit 21637fd6de68765bb67499bb12142f1178856e33
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/app/qgsfieldsproperties.cpp
@@ -996,27 +996,27 @@ void QgsFieldsProperties::apply()

if ( cfg.mConstraints & QgsFieldConstraints::ConstraintNotNull )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintNotNull, QgsFieldConstraints::ConstraintStrengthHard ) );
mLayer->setFieldConstraint( idx, QgsFieldConstraints::ConstraintNotNull, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintNotNull, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintNotNull );
mLayer->removeFieldConstraint( idx, QgsFieldConstraints::ConstraintNotNull );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintUnique )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintUnique, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintUnique, QgsFieldConstraints::ConstraintStrengthHard ) );
mLayer->setFieldConstraint( idx, QgsFieldConstraints::ConstraintUnique, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintUnique, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintUnique );
mLayer->removeFieldConstraint( idx, QgsFieldConstraints::ConstraintUnique );
}
if ( cfg.mConstraints & QgsFieldConstraints::ConstraintExpression )
{
mLayer->setFieldConstraint( i, QgsFieldConstraints::ConstraintExpression, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintExpression, QgsFieldConstraints::ConstraintStrengthHard ) );
mLayer->setFieldConstraint( idx, QgsFieldConstraints::ConstraintExpression, cfg.mConstraintStrength.value( QgsFieldConstraints::ConstraintExpression, QgsFieldConstraints::ConstraintStrengthHard ) );
}
else
{
mLayer->removeFieldConstraint( i, QgsFieldConstraints::ConstraintExpression );
mLayer->removeFieldConstraint( idx, QgsFieldConstraints::ConstraintExpression );
}

if ( mFieldsList->item( i, AttrWMSCol )->checkState() == Qt::Unchecked )

0 comments on commit 21637fd

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