Small code beautification

This commit is contained in:
Matthias Kuhn 2016-09-08 11:56:30 +02:00
parent 8cf0ef93c4
commit 2e9715386d
2 changed files with 9 additions and 8 deletions

View File

@ -81,7 +81,7 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
// constraints management
updateAllConstaints();
updateAllConstraints();
}
QgsAttributeForm::~QgsAttributeForm()
@ -720,7 +720,7 @@ void QgsAttributeForm::onAttributeChanged( const QVariant& value )
emit attributeChanged( eww->field().name(), value );
}
void QgsAttributeForm::updateAllConstaints()
void QgsAttributeForm::updateAllConstraints()
{
Q_FOREACH ( QgsWidgetWrapper* ww, mWidgets )
{
@ -740,8 +740,7 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )
eww->updateConstraint( ft );
// update eww dependencies constraint
QList<QgsEditorWidgetWrapper*> deps;
constraintDependencies( eww, deps );
QList<QgsEditorWidgetWrapper*> deps = constraintDependencies( eww );
Q_FOREACH ( QgsEditorWidgetWrapper* depsEww, deps )
depsEww->updateConstraint( ft );
@ -925,9 +924,9 @@ void QgsAttributeForm::onConstraintStatusChanged( const QString& constraint,
}
}
void QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w,
QList<QgsEditorWidgetWrapper*>& wDeps )
QList<QgsEditorWidgetWrapper*> QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w )
{
QList<QgsEditorWidgetWrapper*> wDeps;
QString name = w->field().name();
// for each widget in the current form
@ -955,6 +954,8 @@ void QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w,
}
}
}
return wDeps;
}
void QgsAttributeForm::preventFeatureRefresh()

View File

@ -321,11 +321,11 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
QString createFilterExpression() const;
//! constraints management
void updateAllConstaints();
void updateAllConstraints();
void updateConstraints( QgsEditorWidgetWrapper* w );
bool currentFormFeature( QgsFeature& feature );
bool currentFormValidConstraints( QStringList& invalidFields, QStringList& descriptions );
void constraintDependencies( QgsEditorWidgetWrapper* w, QList<QgsEditorWidgetWrapper*>& wDeps );
QList<QgsEditorWidgetWrapper*> constraintDependencies( QgsEditorWidgetWrapper* w );
void clearInvalidConstraintsMessage();
void displayInvalidConstraintMessage( const QStringList& invalidFields,
const QStringList& description );