mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Tweak processing algorithm scope -- parameters should be available even if algorithm is unset
This commit is contained in:
parent
2d3b8c8ee3
commit
8e49e94d92
@ -1297,14 +1297,14 @@ QgsExpressionContextScope *QgsExpressionContextUtils::processingAlgorithmScope(
|
||||
Q_UNUSED( context );
|
||||
|
||||
std::unique_ptr< QgsExpressionContextScope > scope( new QgsExpressionContextScope( QObject::tr( "Algorithm" ) ) );
|
||||
scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );
|
||||
|
||||
if ( !algorithm )
|
||||
return scope.release();
|
||||
|
||||
//add standard algorithm variables
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "algorithm_id" ), algorithm->id(), true ) );
|
||||
|
||||
scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );
|
||||
|
||||
return scope.release();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user