Skip to content
Permalink
Browse files

[layouts] Better error messages when atlas exports fail, hinting that…

… path may be invalid and using correct file format
  • Loading branch information
nyalldawson committed Jul 19, 2018
1 parent 5167054 commit 3abbb475276b3fd601e023d659aefbd5b7dc3196
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/layout/qgslayoutexporter.cpp
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}

0 comments on commit 3abbb47

Please sign in to comment.
You can’t perform that action at this time.