Skip to content

Commit

Permalink
apply #6281
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 4, 2012
1 parent 14cad93 commit b121a2f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gui/qgsattributeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed

case QgsVectorLayer::ValueRelation:
{
QSettings settings;
QString nullValue = settings.value( "qgis/nullValue", "NULL" ).toString();

const QgsVectorLayer::ValueRelationData &data = vl->valueRelation( idx );

QgsVectorLayer *layer = qobject_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( data.mLayer ) );
Expand All @@ -209,9 +206,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
if ( !data.mFilterAttributeColumn.isNull() )
fi = layer->fieldNameIndex( data.mFilterAttributeColumn );

if ( data.mAllowNull )
map.insert( nullValue, tr( "(no selection)" ) );

if ( ki >= 0 && vi >= 0 )
{
QgsAttributeList attributes;
Expand All @@ -236,6 +230,12 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
QComboBox *cb = comboBox( editor, parent );
if ( cb )
{
if ( data.mAllowNull )
{
QSettings settings;
cb->addItem( tr( "(no selection)" ), settings.value( "qgis/nullValue", "NULL" ).toString() );
}

for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); it++ )
{
if ( data.mOrderByValue )
Expand Down

0 comments on commit b121a2f

Please sign in to comment.