Skip to content

Commit

Permalink
field expression widget: silence connect/disconnect noise
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 4, 2016
1 parent 004b207 commit bc8a2e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsfieldexpressionwidget.cpp
Expand Up @@ -150,7 +150,8 @@ void QgsFieldExpressionWidget::setLayer( QgsMapLayer *layer )

void QgsFieldExpressionWidget::setLayer( QgsVectorLayer *layer )
{
disconnect( mFieldProxyModel->sourceFieldModel()->layer(), SIGNAL( updatedFields() ), this, SLOT( reloadLayer() ) );
if ( mFieldProxyModel->sourceFieldModel()->layer() )
disconnect( mFieldProxyModel->sourceFieldModel()->layer(), SIGNAL( updatedFields() ), this, SLOT( reloadLayer() ) );

mExpressionContext.reset( new QgsExpressionContext() );
mExpressionContext->appendScope( QgsExpressionContextUtils::globalScope() );
Expand All @@ -160,7 +161,8 @@ void QgsFieldExpressionWidget::setLayer( QgsVectorLayer *layer )

mFieldProxyModel->sourceFieldModel()->setLayer( layer );

connect( mFieldProxyModel->sourceFieldModel()->layer(), SIGNAL( updatedFields() ), SLOT( reloadLayer() ), Qt::UniqueConnection );
if ( mFieldProxyModel->sourceFieldModel()->layer() )
connect( mFieldProxyModel->sourceFieldModel()->layer(), SIGNAL( updatedFields() ), SLOT( reloadLayer() ), Qt::UniqueConnection );
}

void QgsFieldExpressionWidget::setField( const QString &fieldName )
Expand Down

0 comments on commit bc8a2e4

Please sign in to comment.