Skip to content
Permalink
Browse files

fix lack of management of input as QgsProcessingOutputLayerDefinition

  • Loading branch information
luipir authored and nyalldawson committed Sep 20, 2018
1 parent 006553f commit d641b306d3bdce85c005e1d374d9baeb824473e1
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/core/processing/models/qgsprocessingmodelalgorithm.cpp
@@ -529,6 +529,15 @@ QMap<QString, QgsProcessingModelAlgorithm::VariableDefinition> QgsProcessingMode

};

if ( value.canConvert<QgsProcessingOutputLayerDefinition>() )
{
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( value );
value = fromVar.sink;
if ( value.canConvert<QgsProperty>() )
{
value = value.value< QgsProperty >().valueAsString( context.expressionContext() );
}
}
QgsMapLayer *layer = qobject_cast< QgsMapLayer * >( qvariant_cast<QObject *>( value ) );
if ( !layer )
layer = QgsProcessingUtils::mapLayerFromString( value.toString(), context );
@@ -588,6 +597,10 @@ QMap<QString, QgsProcessingModelAlgorithm::VariableDefinition> QgsProcessingMode
{
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( value );
value = fromVar.sink;
if ( value.canConvert<QgsProperty>() )
{
value = value.value< QgsProperty >().valueAsString( context.expressionContext() );
}
}
if ( QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( qvariant_cast<QObject *>( value ) ) )
{

0 comments on commit d641b30

Please sign in to comment.
You can’t perform that action at this time.