QtPrintSupport - Fix Mac printerName() use
authorJohn Layt <jlayt@kde.org>
Mon, 14 May 2012 19:27:21 +0000 (20:27 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 23 May 2012 21:55:43 +0000 (23:55 +0200)
commitf3ad57e90ecc33f3d4de7bf8d612abc0ccb2fb6e
tree5fe5fae79d664224376938c4c9405a5652495d82
parente9d20b1951657ace845f730df3c924ddadcf15af
QtPrintSupport - Fix Mac printerName() use

Mac in Qt4 and 5 has been using the PMPrinter Name for the QPrinter
and QPrinterInfo printerName() value, but this is incorrect. This
is in fact the CUPS Description field, is in human readable form
and is not guaranteed to be unique. The CUPS Name field is the
PMPrinter ID value and should be used as the unique identifier
when accessing printers. This has worked up to now due to an
undocumented feature in the OSX api that accepted the Name when
the ID should be used.

Changing all uses of PMPrinterGetName to PMPrinterGetID fixes this
and allows the QPrinterInfo test of names to pass without
munging the names.

Change-Id: I25322aa1a924bed9f67f4ad5e208274c8b700e17
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
src/plugins/platforms/cocoa/qcocoaprintersupport.mm
src/plugins/platforms/cocoa/qprintengine_mac.mm
tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp