Skip to content

Commit 9e8c995

Browse files
committed
[processing] Pass algorithm configuration on run
Because if it's not passed here, it's basically like writing it to /dev/null right from the beginning.
1 parent 5b7b7be commit 9e8c995

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

python/core/processing/qgsprocessingalgorithm.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Returns true if this algorithm generates HTML outputs.
276276
%End
277277

278278
QVariantMap run( const QVariantMap &parameters,
279-
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok /Out/ = 0 ) const;
279+
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok /Out/ = 0, const QVariantMap &configuration = QVariantMap() ) const;
280280
%Docstring
281281
Executes the algorithm using the specified ``parameters``. This method internally
282282
creates a copy of the algorithm before running it, so it is safe to call

src/core/processing/models/qgsprocessingmodelalgorithm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
288288

289289
bool ok = false;
290290
std::unique_ptr< QgsProcessingAlgorithm > childAlg( child.algorithm()->create( child.configuration() ) );
291-
QVariantMap results = childAlg->run( childParams, context, &modelFeedback, &ok );
291+
QVariantMap results = childAlg->run( childParams, context, &modelFeedback, &ok, child.configuration() );
292292
childAlg.reset( nullptr );
293293
if ( !ok )
294294
{

src/core/processing/qgsprocessingalgorithm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ bool QgsProcessingAlgorithm::hasHtmlOutputs() const
371371
return false;
372372
}
373373

374-
QVariantMap QgsProcessingAlgorithm::run( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok ) const
374+
QVariantMap QgsProcessingAlgorithm::run( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok, const QVariantMap &configuration ) const
375375
{
376-
std::unique_ptr< QgsProcessingAlgorithm > alg( create() );
376+
std::unique_ptr< QgsProcessingAlgorithm > alg( create( configuration ) );
377377
if ( ok )
378378
*ok = false;
379379

src/core/processing/qgsprocessingalgorithm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
311311
* if you need to run algorithms from a background thread, or use the QgsProcessingAlgRunnerTask class.
312312
*/
313313
QVariantMap run( const QVariantMap &parameters,
314-
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok SIP_OUT = nullptr ) const;
314+
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok SIP_OUT = nullptr, const QVariantMap &configuration = QVariantMap() ) const;
315315

316316
/**
317317
* Prepares the algorithm for execution. This must be run in the main thread, and allows the algorithm

0 commit comments

Comments
 (0)