diff options
author | John Layt <jlayt@kde.org> | 2014-04-16 15:47:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-18 07:45:11 +0200 |
commit | 4e4b2d67010f1fc90a0227c36adab56a3e1ce679 (patch) | |
tree | fa193955a97e5431d43c9572fb2dd264b09b5f3e /src/printsupport/dialogs/qprintdialog_mac.mm | |
parent | 6e26bd5fa26489034fe5d035bb4c5034455aa24d (diff) |
QPrintDialog - Fix mac change of printer name
If the user changes the printer name in the Mac print dialog then
update the print device in QPrint to reflect this.
Task-number: QTBUG-37808
Change-Id: I3aaf27e2db7277ab083dc8f8d59f0f80ecd424f1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/printsupport/dialogs/qprintdialog_mac.mm')
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_mac.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 9ff7c4766a..33a11cc079 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -143,11 +143,11 @@ QT_USE_NAMESPACE CFURLGetFileSystemRepresentation(file, true, localFile, sizeof(localFile)); printer->setOutputFileName(QString::fromUtf8(reinterpret_cast<const char *>(localFile))); } else { - // Keep output format. - QPrinter::OutputFormat format; - format = printer->outputFormat(); - printer->setOutputFileName(QString()); - printer->setOutputFormat(format); + PMPrinter macPrinter; + PMSessionGetCurrentPrinter(session, &macPrinter); + QString printerId = QString::fromCFString(PMPrinterGetID(macPrinter)); + if (printer->printerName() != printerId) + printer->setPrinterName(printerId); } } |