diff options
author | John Layt <jlayt@kde.org> | 2012-05-14 21:02:13 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-29 23:48:15 +0200 |
commit | 44f7df439f729aff50f9d1b9dbba06391f151604 (patch) | |
tree | fbe08fcf66c619b0677d6be33b8b6fbc10d4002b /src/plugins/platforms/cocoa/qcocoaprintersupport.mm | |
parent | b7104d6645e25892d85e6e0aad6ddebbd2babdc0 (diff) |
QtPrintSupport - Add QPrinterInfo api for more printer details
A previous commit changed the Mac behaviour for printerName()
from returning the CUPS Description to returning the CUPS Name.
In case anyone was relying on this for a human-readable name
add new api to return the CUPS Description. Also add the
Location and Make and Model which will be used in the Unix
print dialog instead of directly calling CUPS.
Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaprintersupport.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaprintersupport.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm index 2ded23ac05..b77d5a20ea 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm +++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm @@ -129,6 +129,12 @@ QPrinterInfo QCocoaPrinterSupport::printerInfoFromPMPrinter(const PMPrinter &pri return QPrinterInfo(); QPrinterInfo pi = QPrinterInfo(QCFString::toQString(PMPrinterGetID(printer))); + + pi.d_func()->description = QCFString::toQString(PMPrinterGetName(printer)); + pi.d_func()->location = QCFString::toQString(PMPrinterGetLocation(printer)); + CFStringRef makeAndModel; + PMPrinterGetMakeAndModelName(printer, &makeAndModel); + pi.d_func()->makeAndModel = QCFString::toQString(makeAndModel); pi.d_func()->isDefault = PMPrinterIsDefault(printer); return pi; |