Skip to content

Commit

Permalink
[processing] Fix broken API in rasterize alg
Browse files Browse the repository at this point in the history
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 5, 2020
1 parent 223dfaf commit 41cdd40
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/analysis/processing/qgsalgorithmrasterize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ),
Expand Down

0 comments on commit 41cdd40

Please sign in to comment.