Skip to content

Commit 247980b

Browse files
committed
keep coding consistent
1 parent 9912d99 commit 247980b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/app/qgsattributedialog.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
177177
//show attribute alias if available
178178
QString myFieldName = vl->attributeDisplayName( fldIdx );
179179
int myFieldType = theFields[fldIdx].type();
180-
bool isEditable = vl->fieldEditable( fldIdx );
181180

182181
QWidget *myWidget = QgsAttributeEditor::createAttributeEditor( 0, 0, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
183182
if ( !myWidget )
@@ -205,7 +204,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
205204

206205
if ( vl->editType( fldIdx ) != QgsVectorLayer::Immutable )
207206
{
208-
myWidget->setEnabled( vl->isEditable() && isEditable );
207+
myWidget->setEnabled( vl->isEditable() && vl->fieldEditable(fldIdx) );
209208
}
210209

211210
mypInnerLayout->addWidget( myWidget, index, 1 );
@@ -234,15 +233,13 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
234233
if ( !myWidgets.size() )
235234
continue;
236235

237-
bool isEditable = vl->fieldEditable( fldIdx );
238-
239236
for ( QList<QWidget *>::const_iterator itw = myWidgets.begin(); itw != myWidgets.end(); ++itw )
240237
{
241238
QgsAttributeEditor::createAttributeEditor( mDialog, *itw, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
242239

243240
if ( vl->editType( fldIdx ) != QgsVectorLayer::Immutable )
244241
{
245-
( *itw )->setEnabled(( *itw )->isEnabled() && vl->isEditable() && isEditable );
242+
( *itw )->setEnabled( (*itw)->isEnabled() && vl->isEditable() && vl->fieldEditable( fldIdx ) );
246243
}
247244
}
248245
}

0 commit comments

Comments
 (0)