Skip to content

Commit 2e97153

Browse files
committed
Small code beautification
1 parent 8cf0ef9 commit 2e97153

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/gui/qgsattributeform.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
8181
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
8282

8383
// constraints management
84-
updateAllConstaints();
84+
updateAllConstraints();
8585
}
8686

8787
QgsAttributeForm::~QgsAttributeForm()
@@ -720,7 +720,7 @@ void QgsAttributeForm::onAttributeChanged( const QVariant& value )
720720
emit attributeChanged( eww->field().name(), value );
721721
}
722722

723-
void QgsAttributeForm::updateAllConstaints()
723+
void QgsAttributeForm::updateAllConstraints()
724724
{
725725
Q_FOREACH ( QgsWidgetWrapper* ww, mWidgets )
726726
{
@@ -740,8 +740,7 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )
740740
eww->updateConstraint( ft );
741741

742742
// update eww dependencies constraint
743-
QList<QgsEditorWidgetWrapper*> deps;
744-
constraintDependencies( eww, deps );
743+
QList<QgsEditorWidgetWrapper*> deps = constraintDependencies( eww );
745744

746745
Q_FOREACH ( QgsEditorWidgetWrapper* depsEww, deps )
747746
depsEww->updateConstraint( ft );
@@ -925,9 +924,9 @@ void QgsAttributeForm::onConstraintStatusChanged( const QString& constraint,
925924
}
926925
}
927926

928-
void QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w,
929-
QList<QgsEditorWidgetWrapper*>& wDeps )
927+
QList<QgsEditorWidgetWrapper*> QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w )
930928
{
929+
QList<QgsEditorWidgetWrapper*> wDeps;
931930
QString name = w->field().name();
932931

933932
// for each widget in the current form
@@ -955,6 +954,8 @@ void QgsAttributeForm::constraintDependencies( QgsEditorWidgetWrapper* w,
955954
}
956955
}
957956
}
957+
958+
return wDeps;
958959
}
959960

960961
void QgsAttributeForm::preventFeatureRefresh()

src/gui/qgsattributeform.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
321321
QString createFilterExpression() const;
322322

323323
//! constraints management
324-
void updateAllConstaints();
324+
void updateAllConstraints();
325325
void updateConstraints( QgsEditorWidgetWrapper* w );
326326
bool currentFormFeature( QgsFeature& feature );
327327
bool currentFormValidConstraints( QStringList& invalidFields, QStringList& descriptions );
328-
void constraintDependencies( QgsEditorWidgetWrapper* w, QList<QgsEditorWidgetWrapper*>& wDeps );
328+
QList<QgsEditorWidgetWrapper*> constraintDependencies( QgsEditorWidgetWrapper* w );
329329
void clearInvalidConstraintsMessage();
330330
void displayInvalidConstraintMessage( const QStringList& invalidFields,
331331
const QStringList& description );

0 commit comments

Comments
 (0)