Skip to content

Commit c59aeab

Browse files
committedJul 12, 2017
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)
1 parent 0b737ff commit c59aeab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/core/processing/qgsprocessingprovider.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ bool QgsProcessingProvider::addAlgorithm( QgsProcessingAlgorithm *algorithm )
6565
if ( mAlgorithms.contains( algorithm->name() ) )
6666
return false;
6767

68+
// init the algorithm - this allows direct querying of the algorithm's parameters
69+
// and outputs from the provider's copy
70+
algorithm->initAlgorithm( QVariantMap() );
71+
6872
algorithm->setProvider( this );
6973
mAlgorithms.insert( algorithm->name(), algorithm );
7074
return true;

0 commit comments

Comments
 (0)
Please sign in to comment.