Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] determive correct output type based on the
QgsProcessingParameterFileDestination filter

(cherry picked from commit 73a8b80)
  • Loading branch information
alexbruy committed Mar 2, 2018
1 parent a2bf1ab commit 511fa36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/processing/qgsprocessingparameters.cpp
Expand Up @@ -3386,7 +3386,14 @@ QString QgsProcessingParameterFileDestination::valueAsPythonString( const QVaria

QgsProcessingOutputDefinition *QgsProcessingParameterFileDestination::toOutputDefinition() const
{
return new QgsProcessingOutputFile( name(), description() );
if ( !mFileFilter.isEmpty() and mFileFilter.contains( QStringLiteral( "html" ), Qt::CaseInsensitive ) )
{
return new QgsProcessingOutputHtml( name(), description() );
}
else
{
return new QgsProcessingOutputFile( name(), description() );
}
}

QString QgsProcessingParameterFileDestination::defaultFileExtension() const
Expand Down

0 comments on commit 511fa36

Please sign in to comment.