Skip to content

Commit

Permalink
Change to just not display null choice in search widget value list
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoedkoop committed Jul 11, 2016
1 parent 6b904e7 commit 5f39455
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ QString QgsValueMapSearchWidgetWrapper::createExpression( QgsSearchWidgetWrapper

QString currentKey = mComboBox->itemData( mComboBox->currentIndex() ).toString();

if ( currentKey == QString( VALUEMAP_NULL_TEXT ) )
if ( flags & EqualTo )
return fieldName + " IS NULL";
if ( flags & NotEqualTo )
return fieldName + " IS NOT NULL";

switch ( fldType )
{
case QVariant::Int:
Expand Down Expand Up @@ -152,7 +146,8 @@ void QgsValueMapSearchWidgetWrapper::initWidget( QWidget* editor )

while ( it != cfg.constEnd() )
{
mComboBox->addItem( it.key(), it.value() );
if ( it.value() != QString( VALUEMAP_NULL_TEXT ) )
mComboBox->addItem( it.key(), it.value() );
++it;
}
connect( mComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( comboBoxIndexChanged( int ) ) );
Expand Down

0 comments on commit 5f39455

Please sign in to comment.