Skip to content
Permalink
Browse files

[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.
  • Loading branch information
m-kuhn committed Apr 9, 2018
1 parent 5b7b7be commit 9e8c995ac8be8c58740c95a4e243d8fb0541ce2b
@@ -276,7 +276,7 @@ Returns true if this algorithm generates HTML outputs.
%End

QVariantMap run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok /Out/ = 0 ) const;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok /Out/ = 0, const QVariantMap &configuration = QVariantMap() ) const;
%Docstring
Executes the algorithm using the specified ``parameters``. This method internally
creates a copy of the algorithm before running it, so it is safe to call
@@ -288,7 +288,7 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa

bool ok = false;
std::unique_ptr< QgsProcessingAlgorithm > childAlg( child.algorithm()->create( child.configuration() ) );
QVariantMap results = childAlg->run( childParams, context, &modelFeedback, &ok );
QVariantMap results = childAlg->run( childParams, context, &modelFeedback, &ok, child.configuration() );
childAlg.reset( nullptr );
if ( !ok )
{
@@ -371,9 +371,9 @@ bool QgsProcessingAlgorithm::hasHtmlOutputs() const
return false;
}

QVariantMap QgsProcessingAlgorithm::run( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok ) const
QVariantMap QgsProcessingAlgorithm::run( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok, const QVariantMap &configuration ) const
{
std::unique_ptr< QgsProcessingAlgorithm > alg( create() );
std::unique_ptr< QgsProcessingAlgorithm > alg( create( configuration ) );
if ( ok )
*ok = false;

@@ -311,7 +311,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
* if you need to run algorithms from a background thread, or use the QgsProcessingAlgRunnerTask class.
*/
QVariantMap run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok SIP_OUT = nullptr ) const;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, bool *ok SIP_OUT = nullptr, const QVariantMap &configuration = QVariantMap() ) const;

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

0 comments on commit 9e8c995

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