Skip to content

Commit

Permalink
fix QgsProcessingParameters::parameterAsInts
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Jun 10, 2021
1 parent 16a05d3 commit 3aaff14
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/core/processing/qgsprocessingparametermeshdataset.cpp
Expand Up @@ -123,7 +123,6 @@ QList<int> QgsProcessingParameterMeshDatasetGroups::valueAsDatasetGroup( const Q
{
if ( value.type() == QVariant::List )
{
//here we can't use QgsProcessingParameters::parameterAsInts() because this method return empty list when first value is 0...
const QVariantList varList = value.toList();
if ( varList.isEmpty() )
ret << 0;
Expand Down
3 changes: 1 addition & 2 deletions src/core/processing/qgsprocessingparameters.cpp
Expand Up @@ -280,9 +280,8 @@ QList< int > QgsProcessingParameters::parameterAsInts( const QgsProcessingParame
}
}

if ( ( resultList.isEmpty() || resultList.at( 0 ) == 0 ) )
if ( resultList.isEmpty() )
{
resultList.clear();
// check default
if ( definition->defaultValue().isValid() )
{
Expand Down
4 changes: 1 addition & 3 deletions src/gui/processing/qgsprocessingmeshdatasetwidget.cpp
Expand Up @@ -299,9 +299,7 @@ void QgsProcessingMeshDatasetGroupsWidgetWrapper::setWidgetValue( const QVariant
if ( value.type() == QVariant::List )
{
//here we can't use QgsProcessingParameters::parameterAsInts() because this method return empry list when first value is 0...
const QVariantList varList = value.toList();
for ( const QVariant &v : varList )
datasetGroupIndexes.append( QgsProcessingParameters::parameterAsInt( parameterDefinition(), v, context ) );
datasetGroupIndexes = QgsProcessingParameters::parameterAsInts( parameterDefinition(), value, context );
}
else
datasetGroupIndexes.append( QgsProcessingParameters::parameterAsInt( parameterDefinition(), value, context ) );
Expand Down

0 comments on commit 3aaff14

Please sign in to comment.