Skip to content

Commit 35ecdd1

Browse files
committedOct 22, 2016
Fix issues with writing to temporary objects
1 parent a3968a2 commit 35ecdd1

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed
 

‎src/core/qgsvectorlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ void QgsVectorLayer::removeFieldAlias( int attIndex )
21152115
return;
21162116

21172117
QString name = fields().at( attIndex ).name();
2118-
mFields.at( attIndex ).setAlias( QString() );
2118+
mFields[ attIndex ].setAlias( QString() );
21192119
if ( mAttributeAliasMap.contains( name ) )
21202120
{
21212121
mAttributeAliasMap.remove( name );

‎src/core/qgsvectorlayerundocommand.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ void QgsVectorLayerUndoCommandDeleteAttribute::undo()
411411
}
412412
}
413413

414-
mBuffer->L->editFormConfig().setWidgetConfig( mFieldName, mOldEditorWidgetConfig );
414+
QgsEditFormConfig formConfig = mBuffer->L->editFormConfig();
415+
formConfig.setWidgetConfig( mFieldName, mOldEditorWidgetConfig );
416+
mBuffer->L->setEditFormConfig( formConfig );
415417

416418
emit mBuffer->attributeAdded( mFieldIndex );
417419
}

‎src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ void QgsGrassPlugin::addFeature()
515515
grassProvider->setNewFeatureType( GV_AREA );
516516
formSuppress = QgsEditFormConfig::SuppressOn;
517517
}
518-
vectorLayer->editFormConfig().setSuppress( formSuppress );
518+
QgsEditFormConfig formConfig = vectorLayer->editFormConfig();
519+
formConfig.setSuppress( formSuppress );
520+
vectorLayer->setEditFormConfig( formConfig );
519521
}
520522

521523
void QgsGrassPlugin::onSplitFeaturesTriggered( bool checked )

‎src/providers/grass/qgsgrassprovider.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,10 @@ void QgsGrassProvider::startEditing( QgsVectorLayer *vectorLayer )
11281128

11291129
// TODO: enable cats editing once all consequences are implemented
11301130
// disable cat and topo symbol editing
1131-
vectorLayer->editFormConfig().setReadOnly( mLayer->keyColumn(), true );
1132-
vectorLayer->editFormConfig().setReadOnly( mLayer->fields().size() - 1, true );
1131+
QgsEditFormConfig formConfig = vectorLayer->editFormConfig();
1132+
formConfig.setReadOnly( mLayer->keyColumn(), true );
1133+
formConfig.setReadOnly( mLayer->fields().size() - 1, true );
1134+
vectorLayer->setEditFormConfig( formConfig );
11331135

11341136
mEditedCount++;
11351137

0 commit comments

Comments
 (0)
Please sign in to comment.