Skip to content

Commit

Permalink
Use atlas_featurenumber_padded in default filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannQDQ committed Dec 20, 2024
1 parent af60112 commit 4812697
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & )
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 ) );

addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILENAME_EXPRESSION" ), QObject::tr( "Output filename expression" ), QStringLiteral( "'output_'||@atlas_featurenumber" ), QStringLiteral( "COVERAGE_LAYER" ) ) );
addParameter( new QgsProcessingParameterExpression( QStringLiteral( "FILENAME_EXPRESSION" ), QObject::tr( "Output filename expression" ), QStringLiteral( "'output_'||@atlas_featurenumber_padded" ), 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 @@ -359,7 +359,7 @@ QVariantMap QgsLayoutAtlasToMultiplePdfAlgorithm::exportAtlas( QgsLayoutAtlas *a
QgsLayoutExporter::ExportResult result;
if ( atlas->filenameExpression().isEmpty() && filename.isEmpty() )
{
atlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber" ), error );
atlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber_padded" ), error );
}
else if ( !filename.isEmpty() )
{
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster()
return;
}
QString error;
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber" ), error );
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber_padded" ), error );
}
else
{
Expand Down Expand Up @@ -3008,7 +3008,7 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg()
return;
}
QString error;
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber" ), error );
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber_padded" ), error );
}

QString lastUsedDir = defaultExportPath();
Expand Down Expand Up @@ -3200,7 +3200,7 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
return;
}
QString error;
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber" ), error );
printAtlas->setFilenameExpression( QStringLiteral( "'output_'||@atlas_featurenumber_padded" ), error );
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutatlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
QgsLayoutAtlas::QgsLayoutAtlas( QgsLayout *layout )
: QObject( layout )
, mLayout( layout )
, mFilenameExpressionString( QStringLiteral( "'output_'||@atlas_featurenumber" ) )
, mFilenameExpressionString( QStringLiteral( "'output_'||@atlas_featurenumber_padded" ) )
{

//listen out for layer removal
Expand Down

0 comments on commit 4812697

Please sign in to comment.