Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layouts] Better error messages when atlas exports fail, hinting that…
… path may be invalid and using correct file format

(cherry-picked from 3abbb47)
  • Loading branch information
nyalldawson committed Jul 19, 2018
1 parent 693e83b commit a8ef508
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/layout/qgslayoutexporter.cpp
Expand Up @@ -439,7 +439,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToImage( QgsAbstractLay
if ( result != Success )
{
if ( result == FileError )
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
error = QObject::tr( "Cannot write to %1. This file may be open in another application or may be an invalid path." ).arg( QDir::toNativeSeparators( filePath ) );
iterator->endRender();
return result;
}
Expand Down Expand Up @@ -566,7 +566,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToPdf( QgsAbstractLayou
if ( result != Success )
{
if ( result == FileError )
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( fileName );
error = QObject::tr( "Cannot write to %1. This file may be open in another application or may be an invalid path." ).arg( QDir::toNativeSeparators( fileName ) );
iterator->endRender();
return result;
}
Expand Down Expand Up @@ -616,7 +616,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToPdfs( QgsAbstractLayo
if ( result != Success )
{
if ( result == FileError )
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
error = QObject::tr( "Cannot write to %1. This file may be open in another application or may be an invalid path." ).arg( QDir::toNativeSeparators( filePath ) );
iterator->endRender();
return result;
}
Expand Down Expand Up @@ -981,7 +981,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToSvg( QgsAbstractLayou
if ( result != Success )
{
if ( result == FileError )
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
error = QObject::tr( "Cannot write to %1. This file may be open in another application or may be an invalid path." ).arg( QDir::toNativeSeparators( filePath ) );
iterator->endRender();
return result;
}
Expand Down

0 comments on commit a8ef508

Please sign in to comment.