Skip to content

Commit

Permalink
Fix issues with writing to temporary objects
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 22, 2016
1 parent a3968a2 commit 35ecdd1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -2115,7 +2115,7 @@ void QgsVectorLayer::removeFieldAlias( int attIndex )
return;

QString name = fields().at( attIndex ).name();
mFields.at( attIndex ).setAlias( QString() );
mFields[ attIndex ].setAlias( QString() );
if ( mAttributeAliasMap.contains( name ) )
{
mAttributeAliasMap.remove( name );
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsvectorlayerundocommand.cpp
Expand Up @@ -411,7 +411,9 @@ void QgsVectorLayerUndoCommandDeleteAttribute::undo()
}
}

mBuffer->L->editFormConfig().setWidgetConfig( mFieldName, mOldEditorWidgetConfig );
QgsEditFormConfig formConfig = mBuffer->L->editFormConfig();
formConfig.setWidgetConfig( mFieldName, mOldEditorWidgetConfig );
mBuffer->L->setEditFormConfig( formConfig );

emit mBuffer->attributeAdded( mFieldIndex );
}
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -515,7 +515,9 @@ void QgsGrassPlugin::addFeature()
grassProvider->setNewFeatureType( GV_AREA );
formSuppress = QgsEditFormConfig::SuppressOn;
}
vectorLayer->editFormConfig().setSuppress( formSuppress );
QgsEditFormConfig formConfig = vectorLayer->editFormConfig();
formConfig.setSuppress( formSuppress );
vectorLayer->setEditFormConfig( formConfig );
}

void QgsGrassPlugin::onSplitFeaturesTriggered( bool checked )
Expand Down
6 changes: 4 additions & 2 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -1128,8 +1128,10 @@ void QgsGrassProvider::startEditing( QgsVectorLayer *vectorLayer )

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

mEditedCount++;

Expand Down

0 comments on commit 35ecdd1

Please sign in to comment.