Skip to content

Commit

Permalink
Remove optional flag next to Processing algs Boolean parameters - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Dec 11, 2024
1 parent f5447dc commit 3ff6ca6
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion python/plugins/processing/algs/gdal/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def initAlgorithm(self, config=None):
self.USE_Z,
self.tr('Burn value extracted from the "Z" values of the feature'),
defaultValue=False,
optional=True,
)
)
self.addParameter(
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmdbscanclustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void QgsDbscanClusteringAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( new QgsProcessingParameterNumber( QStringLiteral( "MIN_SIZE" ), QObject::tr( "Minimum cluster size" ), Qgis::ProcessingNumberParameterType::Integer, 5, false, 1 ) );
addParameter( new QgsProcessingParameterDistance( QStringLiteral( "EPS" ), QObject::tr( "Maximum distance between clustered points" ), 1, QStringLiteral( "INPUT" ), false, 0 ) );

auto dbscanStarParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "DBSCAN*" ), QObject::tr( "Treat border points as noise (DBSCAN*)" ), false, true );
auto dbscanStarParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "DBSCAN*" ), QObject::tr( "Treat border points as noise (DBSCAN*)" ), false );
dbscanStarParam->setFlags( dbscanStarParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( dbscanStarParam.release() );

Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmextractlabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void QgsExtractLabelsAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( new QgsProcessingParameterBoolean(
QStringLiteral( "INCLUDE_UNPLACED" ),
QObject::tr( "Include unplaced labels" ),
QVariant( true ), true
QVariant( true )
) );

std::unique_ptr<QgsProcessingParameterNumber> dpiParameter = std::make_unique<QgsProcessingParameterNumber>(
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( new QgsProcessingParameterVectorLayer( QStringLiteral( "COVERAGE_LAYER" ), QObject::tr( "Coverage layer" ), QList<int>(), QVariant(), true ) );
addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILTER_EXPRESSION" ), QObject::tr( "Filter expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
addParameter( new QgsProcessingParameterExpression( QStringLiteral( "SORTBY_EXPRESSION" ), QObject::tr( "Sort expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false, true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false ) );

addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILENAME_EXPRESSION" ), QObject::tr( "Output filename expression" ), QStringLiteral( "'output_'||@atlas_featurenumber" ), QStringLiteral( "COVERAGE_LAYER" ) ) );
addParameter( new QgsProcessingParameterFile( QStringLiteral( "FOLDER" ), QObject::tr( "Output folder" ), Qgis::ProcessingFileParameterBehavior::Folder ) );
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & )
addParameter( new QgsProcessingParameterVectorLayer( QStringLiteral( "COVERAGE_LAYER" ), QObject::tr( "Coverage layer" ), QList<int>(), QVariant(), true ) );
addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILTER_EXPRESSION" ), QObject::tr( "Filter expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
addParameter( new QgsProcessingParameterExpression( QStringLiteral( "SORTBY_EXPRESSION" ), QObject::tr( "Sort expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false, true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false ) );

std::unique_ptr<QgsProcessingParameterMultipleLayers> layersParam = std::make_unique<QgsProcessingParameterMultipleLayers>( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true );
layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsalgorithmpointstopaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ QString QgsPointsToPathsAlgorithm::groupId() const
void QgsPointsToPathsAlgorithm::initAlgorithm( const QVariantMap & )
{
addParameter( std::make_unique<QgsProcessingParameterFeatureSource>( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList<int>() << static_cast<int>( Qgis::ProcessingSourceType::VectorPoint ) ) );
addParameter( std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "CLOSE_PATH" ), QObject::tr( "Create closed paths" ), false, true ) );
addParameter( std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "CLOSE_PATH" ), QObject::tr( "Create closed paths" ), false ) );
addParameter( std::make_unique<QgsProcessingParameterExpression>( QStringLiteral( "ORDER_EXPRESSION" ), QObject::tr( "Order expression" ), QVariant(), QStringLiteral( "INPUT" ), true ) );
addParameter( std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "NATURAL_SORT" ), QObject::tr( "Sort text containing numbers naturally" ), false, true ) );
addParameter( std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "NATURAL_SORT" ), QObject::tr( "Sort text containing numbers naturally" ), false ) );
addParameter( std::make_unique<QgsProcessingParameterExpression>( QStringLiteral( "GROUP_EXPRESSION" ), QObject::tr( "Path group expression" ), QVariant(), QStringLiteral( "INPUT" ), true ) );
addParameter( std::make_unique<QgsProcessingParameterFeatureSink>( QStringLiteral( "OUTPUT" ), QObject::tr( "Paths" ), Qgis::ProcessingSourceType::VectorLine ) );
// TODO QGIS 4: remove parameter. move logic to separate algorithm if needed.
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmpolygonize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QString QgsPolygonizeAlgorithm::groupId() const
void QgsPolygonizeAlgorithm::initAlgorithm( const QVariantMap & )
{
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList<int>() << static_cast<int>( Qgis::ProcessingSourceType::VectorLine ) ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "KEEP_FIELDS" ), QObject::tr( "Keep table structure of line layer" ), false, true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "KEEP_FIELDS" ), QObject::tr( "Keep table structure of line layer" ), false ) );
addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Polygons" ), Qgis::ProcessingSourceType::VectorPolygon ) );
addOutput( new QgsProcessingOutputNumber( QStringLiteral( "NUM_POLYGONS" ), QObject::tr( "Number of polygons" ) ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmtransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void QgsTransformAlgorithm::initParameters( const QVariantMap & )
addParameter( new QgsProcessingParameterCrs( QStringLiteral( "TARGET_CRS" ), QObject::tr( "Target CRS" ), QStringLiteral( "EPSG:4326" ) ) );

// Convert curves to straight segments
auto convertCurvesParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "CONVERT_CURVED_GEOMETRIES" ), QObject::tr( "Convert curved geometries to straight segments" ), false, true );
auto convertCurvesParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "CONVERT_CURVED_GEOMETRIES" ), QObject::tr( "Convert curved geometries to straight segments" ), false );
convertCurvesParam->setHelp( QObject::tr( "If checked, curved geometries will be converted to straight segments. Otherwise, they will be kept as curves. This can fix distortion issues." ) );
addParameter( convertCurvesParam.release() );

Expand Down
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsalgorithmxyztiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ void QgsXyzTilesDirectoryAlgorithm::initAlgorithm( const QVariantMap & )
createCommonParameters();
addParameter( new QgsProcessingParameterNumber( QStringLiteral( "TILE_WIDTH" ), QObject::tr( "Tile width" ), Qgis::ProcessingNumberParameterType::Integer, 256, false, 1, 4096 ) );
addParameter( new QgsProcessingParameterNumber( QStringLiteral( "TILE_HEIGHT" ), QObject::tr( "Tile height" ), Qgis::ProcessingNumberParameterType::Integer, 256, false, 1, 4096 ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "TMS_CONVENTION" ), QObject::tr( "Use inverted tile Y axis (TMS convention)" ), false, true ) );
addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "TMS_CONVENTION" ), QObject::tr( "Use inverted tile Y axis (TMS convention)" ), false ) );

std::unique_ptr<QgsProcessingParameterString> titleParam = std::make_unique<QgsProcessingParameterString>( QStringLiteral( "HTML_TITLE" ), QObject::tr( "Leaflet HTML output title" ), QVariant(), false, true );
titleParam->setFlags( titleParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( titleParam.release() );
std::unique_ptr<QgsProcessingParameterString> attributionParam = std::make_unique<QgsProcessingParameterString>( QStringLiteral( "HTML_ATTRIBUTION" ), QObject::tr( "Leaflet HTML output attribution" ), QVariant(), false, true );
attributionParam->setFlags( attributionParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( attributionParam.release() );
std::unique_ptr<QgsProcessingParameterBoolean> osmParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "HTML_OSM" ), QObject::tr( "Include OpenStreetMap basemap in Leaflet HTML output" ), false, true );
std::unique_ptr<QgsProcessingParameterBoolean> osmParam = std::make_unique<QgsProcessingParameterBoolean>( QStringLiteral( "HTML_OSM" ), QObject::tr( "Include OpenStreetMap basemap in Leaflet HTML output" ), false );
osmParam->setFlags( osmParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( osmParam.release() );

Expand Down

0 comments on commit 3ff6ca6

Please sign in to comment.