Skip to content
Permalink
Browse files
fix QgsProcessingParameters::parameterAsInts
  • Loading branch information
vcloarec authored and nyalldawson committed Jun 10, 2021
1 parent 16a05d3 commit 3aaff145bb85b2a77348f915a5149da15996d112
@@ -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;
@@ -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() )
{
@@ -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 ) );

0 comments on commit 3aaff14

Please sign in to comment.