From 8ebfe00f4ab79516a8276929a682c24f4c675b5f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 21 Aug 2017 14:34:17 +0200 Subject: Initialize the print engine with the given printer name Originally when the QPrinter was created it would create the engine with the default printer and then change it afterwards even though the desired printer may already be known here. So by passing the printer name we ensure that it is initialized with the desired one right away. Task-number: QTBUG-62221 Change-Id: Iaa90243708b57bf89354a527a982ac45c991f603 Reviewed-by: Friedemann Kleint --- src/plugins/printsupport/cups/qcupsprintersupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/printsupport/cups/qcupsprintersupport.cpp') diff --git a/src/plugins/printsupport/cups/qcupsprintersupport.cpp b/src/plugins/printsupport/cups/qcupsprintersupport.cpp index 1887625406..a9c992a2e1 100644 --- a/src/plugins/printsupport/cups/qcupsprintersupport.cpp +++ b/src/plugins/printsupport/cups/qcupsprintersupport.cpp @@ -63,9 +63,9 @@ QCupsPrinterSupport::~QCupsPrinterSupport() { } -QPrintEngine *QCupsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode) +QPrintEngine *QCupsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId) { - return new QCupsPrintEngine(printerMode); + return new QCupsPrintEngine(printerMode, (deviceId.isEmpty() ? defaultPrintDeviceId() : deviceId)); } QPaintEngine *QCupsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode) -- cgit v1.2.3