Skip to content
Permalink
Browse files

Fix issues with writing to temporary objects

  • Loading branch information
nyalldawson committed Oct 22, 2016
1 parent a3968a2 commit 35ecdd1a98c8dbe9e5de782e8f639b1a83328f2d
@@ -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 );
@@ -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 );
}
@@ -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 )
@@ -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++;

0 comments on commit 35ecdd1

Please sign in to comment.
You can’t perform that action at this time.