Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions src/app/qgismobileapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,9 +1166,17 @@ bool QgisMobileapp::print( const QString &layoutName )
else
{
success = printAtlas( layoutToPrint, destination );
if ( success && layoutToPrint->customProperty( QStringLiteral( "singleFile" ), true ).toBool() )
if ( success )
{
openPath = destination;
if ( layoutToPrint->customProperty( QStringLiteral( "singleFile" ), true ).toBool() )
{
openPath = destination;
}
else if ( layoutToPrint->atlas()->count() == 1 )
{
layoutToPrint->atlas()->first();
openPath = layoutsFolder() + '/' + layoutToPrint->atlas()->currentFilename() + QStringLiteral( ".pdf" );
}
}
}

Expand Down Expand Up @@ -1227,18 +1235,20 @@ bool QgisMobileapp::printAtlasFeatures( const QString &layoutName, const QList<l

const QString destination = QStringLiteral( "%1/%2-%3.pdf" ).arg( layoutsFolder(), layoutToPrint->name(), QDateTime::currentDateTime().toString( QStringLiteral( "yyyyMMdd_hhmmss" ) ) );
QString openPath;
if ( layoutToPrint->customProperty( QStringLiteral( "singleFile" ), true ).toBool() )
{
openPath = destination;
}
else if ( ids.size() == 1 )
{
layoutToPrint->atlas()->updateFeatures();
layoutToPrint->atlas()->first();
openPath = layoutsFolder() + '/' + layoutToPrint->atlas()->currentFilename() + QStringLiteral( ".pdf" );
}

const bool success = printAtlas( layoutToPrint, destination );
if ( success )
{
if ( layoutToPrint->customProperty( QStringLiteral( "singleFile" ), true ).toBool() )
{
openPath = destination;
}
else if ( layoutToPrint->atlas()->count() == 1 )
{
layoutToPrint->atlas()->first();
openPath = layoutsFolder() + '/' + layoutToPrint->atlas()->currentFilename() + QStringLiteral( ".pdf" );
}
}

layoutToPrint->atlas()->setFilterExpression( priorFilterExpression, error );
layoutToPrint->atlas()->setFilterFeatures( priorFilterFeatures );
Expand Down
Loading