Skip to content

Commit

Permalink
[processing] Fix 'selected features only' is disabled by default
Browse files Browse the repository at this point in the history
Fixes #36753
  • Loading branch information
nyalldawson committed May 27, 2020
1 parent 11f6d53 commit 0ea7187
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/gui/processing/qgsprocessingmaplayercombobox.cpp
Expand Up @@ -298,11 +298,6 @@ void QgsProcessingMapLayerComboBox::setValue( const QVariant &value, QgsProcessi
if ( !found )
{
const QString string = val.toString();
if ( mUseSelectionCheckBox )
{
mUseSelectionCheckBox->setChecked( false );
mUseSelectionCheckBox->setEnabled( false );
}
if ( mIterateButton )
mIterateButton->setChecked( iterate );

Expand All @@ -316,13 +311,23 @@ void QgsProcessingMapLayerComboBox::setValue( const QVariant &value, QgsProcessi
mCombo->setAdditionalItems( additional );
}
mCombo->setCurrentIndex( mCombo->findText( string ) ); // this may or may not throw a signal, so let's block it..
if ( mUseSelectionCheckBox )
{
mUseSelectionCheckBox->setChecked( false );
mUseSelectionCheckBox->setEnabled( false );
}
mBlockChangedSignal--;
if ( !mBlockChangedSignal )
emit valueChanged(); // and ensure we only ever raise one
}
else if ( mParameter->flags() & QgsProcessingParameterDefinition::FlagOptional )
{
mCombo->setLayer( nullptr );
if ( mUseSelectionCheckBox )
{
mUseSelectionCheckBox->setChecked( false );
mUseSelectionCheckBox->setEnabled( false );
}
}
}
}
Expand Down

0 comments on commit 0ea7187

Please sign in to comment.