Skip to content

Commit

Permalink
Temporarily make QgsProcessingAlgorithm::run non pure-virtual (for tr…
Browse files Browse the repository at this point in the history
…avis)
  • Loading branch information
nyalldawson committed May 10, 2017
1 parent 3706d88 commit 02b560e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/core/processing/qgsprocessingalgorithm.sip
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class QgsProcessingAlgorithm
void setProvider( QgsProcessingProvider *provider );

virtual bool run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs /Out/ ) const = 0;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs /Out/ ) const;
%Docstring
Runs the algorithm using the specified ``parameters``. Algorithms should implement
their custom processing logic here.
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/qgsnativealgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool QgsBufferAlgorithm::run( const QVariantMap &parameters, QgsProcessingContex
std::unique_ptr< QgsFeatureSink > writer( QgsProcessingUtils::createFeatureSink( dest, QString(), layer->fields(), QgsWkbTypes::Point, layer->crs(), context, outputLayer ) );

// fixed parameters
bool dissolve = QgsProcessingParameters::parameterAsBool( parameters, QStringLiteral( "DISSOLVE" ), context );
//bool dissolve = QgsProcessingParameters::parameterAsBool( parameters, QStringLiteral( "DISSOLVE" ), context );
int segments = QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "DISSOLVE" ), context );
QgsGeometry::EndCapStyle endCapStyle = static_cast< QgsGeometry::EndCapStyle >( QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "END_CAP_STYLE" ), context ) );
QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle>( QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "JOIN_STYLE" ), context ) );
Expand Down
5 changes: 5 additions & 0 deletions src/core/processing/qgsprocessingalgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ void QgsProcessingAlgorithm::setProvider( QgsProcessingProvider *provider )
{
mProvider = provider;
}

bool QgsProcessingAlgorithm::run( const QVariantMap &, QgsProcessingContext &, QgsProcessingFeedback *, QVariantMap & ) const
{
return true;
}
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingalgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
* \returns true if algorithm run was successful, or false if run was unsuccessful.
*/
virtual bool run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs SIP_OUT ) const = 0;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs SIP_OUT ) const;

private:

Expand Down

0 comments on commit 02b560e

Please sign in to comment.