Skip to content
Permalink
Browse files

Port another member to c++

  • Loading branch information
nyalldawson committed Jun 23, 2017
1 parent 3249015 commit a8b364e2e2132d7b583d9610d2cd01f69b13d796
@@ -573,6 +573,8 @@ Copies are protected to avoid slicing

virtual bool canExecute( QString *errorMessage /Out/ = 0 ) const;

virtual QString asPythonCommand( const QVariantMap &parameters, QgsProcessingContext &context ) const;


void setName( const QString &name );
%Docstring
@@ -224,12 +224,6 @@ def resolveValue(self, value, param):
v = value
return param.evaluateForModeler(v, self)

def asPythonCommand(self, parameters, context):
if self.sourceFilePath():
return QgsProcessingAlgorithm.asPythonCommand(self, parameters, context)
else:
return None

def toPython(self):
s = ['##%s=name' % self.name()]
for param in list(self.parameterComponents().values()):
@@ -915,6 +915,14 @@ bool QgsProcessingModelAlgorithm::canExecute( QString *errorMessage ) const
return true;
}

QString QgsProcessingModelAlgorithm::asPythonCommand( const QVariantMap &parameters, QgsProcessingContext &context ) const
{
if ( mSourceFile.isEmpty() )
return QString(); // temporary model - can't run as python command

return QgsProcessingAlgorithm::asPythonCommand( parameters, context );
}


bool QgsProcessingModelAlgorithm::ChildParameterSource::operator==( const QgsProcessingModelAlgorithm::ChildParameterSource &other ) const
{
@@ -573,6 +573,7 @@ class CORE_EXPORT QgsProcessingModelAlgorithm : public QgsProcessingAlgorithm
QString helpUrl() const override;

bool canExecute( QString *errorMessage SIP_OUT = nullptr ) const override;
QString asPythonCommand( const QVariantMap &parameters, QgsProcessingContext &context ) const override;

/**
* Sets the model \a name.

0 comments on commit a8b364e

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