Skip to content
Permalink
Browse files

[processing] Fix broken API in rasterize alg

A string parameter was converted to a enum value, breaking the existing
stable API and preventing use from models and scripts
  • Loading branch information
nyalldawson committed Jan 4, 2020
1 parent 223dfaf commit 41cdd40f7a20f26db71429bad1982231441a7eb5
Showing with 7 additions and 10 deletions.
  1. +7 −10 src/analysis/processing/qgsalgorithmrasterize.cpp
@@ -89,16 +89,13 @@ void QgsRasterizeAlgorithm::initAlgorithm( const QVariantMap & )
QStringLiteral( "MAKE_BACKGROUND_TRANSPARENT" ),
QObject::tr( "Make background transparent" ),
false ) );
QStringList mapThemes { QgsProject::instance()->mapThemeCollection()->mapThemes() };
mapThemes.prepend( QString() );
addParameter( new QgsProcessingParameterEnum(
QStringLiteral( "MAP_THEME" ),
QObject::tr( "Map theme to render" ),
mapThemes,
false,
QString(),
true
) );

std::unique_ptr< QgsProcessingParameterString > mapThemeParam = qgis::make_unique< QgsProcessingParameterString >(
QStringLiteral( "MAP_THEME" ),
QObject::tr( "Map theme to render" ),
QVariant(), false, true );
addParameter( mapThemeParam.release() );

QList<QgsMapLayer *> projectLayers { QgsProject::instance()->mapLayers().values() };
addParameter( new QgsProcessingParameterMultipleLayers(
QStringLiteral( "LAYERS" ),

0 comments on commit 41cdd40

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