Skip to content
Permalink
Browse files

Initialise algorithms when they are added to a provider

By initializing the prototype of the algorithm stored in the
provider we allow shortcuts like directly querying the parameter
definitions from the provider's prototype (instead of having
to create a new instance and manually initialize it first)
  • Loading branch information
nyalldawson committed Jul 12, 2017
1 parent 0b737ff commit c59aeab544eda7a3b78ae67e89db0cdf5ed9ce26
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/processing/qgsprocessingprovider.cpp
@@ -65,6 +65,10 @@ bool QgsProcessingProvider::addAlgorithm( QgsProcessingAlgorithm *algorithm )
if ( mAlgorithms.contains( algorithm->name() ) )
return false;

// init the algorithm - this allows direct querying of the algorithm's parameters
// and outputs from the provider's copy
algorithm->initAlgorithm( QVariantMap() );

algorithm->setProvider( this );
mAlgorithms.insert( algorithm->name(), algorithm );
return true;

0 comments on commit c59aeab

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