Skip to content
Permalink
Browse files

[layouts] Set printer document name when printing layouts

Makes for better display in desktop print job queues

(cherry picked from commit 46356c8)
  • Loading branch information
nyalldawson committed Aug 26, 2018
1 parent 96cf972 commit 2e42525a95b6d075ac9ceee62df8e1b685a64840
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/app/layout/qgslayoutdesignerdialog.cpp
@@ -1765,7 +1765,9 @@ void QgsLayoutDesignerDialog::print()

QgsLayoutExporter exporter( mLayout );
QString printerName = printer()->printerName();
switch ( exporter.print( *printer(), printSettings ) )
QPrinter *p = printer();
p->setDocName( mMasterLayout->name() );
switch ( exporter.print( *p, printSettings ) )
{
case QgsLayoutExporter::Success:
{
@@ -2348,8 +2350,10 @@ void QgsLayoutDesignerDialog::printAtlas()
feedback->cancel();
} );

QString printerName = printer()->printerName();
switch ( QgsLayoutExporter::print( printAtlas, *printer(), printSettings, error, feedback.get() ) )
QPrinter *p = printer();
p->setDocName( mMasterLayout->name() );
QString printerName = p->printerName();
switch ( QgsLayoutExporter::print( printAtlas, *p, printSettings, error, feedback.get() ) )
{
case QgsLayoutExporter::Success:
{
@@ -3346,8 +3350,10 @@ void QgsLayoutDesignerDialog::printReport()
feedback->cancel();
} );

QString printerName = printer()->printerName();
switch ( QgsLayoutExporter::print( static_cast< QgsReport * >( mMasterLayout ), *printer(), printSettings, error, feedback.get() ) )
QPrinter *p = printer();
QString printerName = p->printerName();
p->setDocName( mMasterLayout->name() );
switch ( QgsLayoutExporter::print( static_cast< QgsReport * >( mMasterLayout ), *p, printSettings, error, feedback.get() ) )
{
case QgsLayoutExporter::Success:
{

0 comments on commit 2e42525

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