Skip to content

Commit a8ef508

Browse files
committedJul 19, 2018
[layouts] Better error messages when atlas exports fail, hinting that path may be invalid and using correct file format
(cherry-picked from 3abbb47)
1 parent 693e83b commit a8ef508

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/core/layout/qgslayoutexporter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToImage( QgsAbstractLay
439439
if ( result != Success )
440440
{
441441
if ( result == FileError )
442-
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
442+
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 ) );
443443
iterator->endRender();
444444
return result;
445445
}
@@ -566,7 +566,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToPdf( QgsAbstractLayou
566566
if ( result != Success )
567567
{
568568
if ( result == FileError )
569-
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( fileName );
569+
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 ) );
570570
iterator->endRender();
571571
return result;
572572
}
@@ -616,7 +616,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToPdfs( QgsAbstractLayo
616616
if ( result != Success )
617617
{
618618
if ( result == FileError )
619-
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
619+
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 ) );
620620
iterator->endRender();
621621
return result;
622622
}
@@ -981,7 +981,7 @@ QgsLayoutExporter::ExportResult QgsLayoutExporter::exportToSvg( QgsAbstractLayou
981981
if ( result != Success )
982982
{
983983
if ( result == FileError )
984-
error = QObject::tr( "Cannot write to %1. This file may be open in another application." ).arg( filePath );
984+
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 ) );
985985
iterator->endRender();
986986
return result;
987987
}

0 commit comments

Comments
 (0)
Please sign in to comment.