Skip to content

Commit

Permalink
fix get layer from output sink from previous algorithm in modeler
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Sep 13, 2018
1 parent 0f07c41 commit 2a19a1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/processing/qgsprocessingparameters.cpp
Expand Up @@ -528,6 +528,18 @@ QgsMapLayer *QgsProcessingParameters::parameterAsLayer( const QgsProcessingParam
return layer;
}

if ( val.canConvert<QgsProcessingOutputLayerDefinition>() )
{
// input is a QgsProcessingOutputLayerDefinition - get extra properties from it
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( val );
val = fromVar.sink;
}

if ( val.canConvert<QgsProperty>() && val.value< QgsProperty >().propertyType() == QgsProperty::StaticProperty )
{
val = val.value< QgsProperty >().staticValue();
}

if ( !val.isValid() || val.toString().isEmpty() )
{
// fall back to default
Expand Down

0 comments on commit 2a19a1d

Please sign in to comment.