diff options
author | John Layt <jlayt@kde.org> | 2012-06-01 20:33:53 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-08 13:33:50 +0200 |
commit | 271b484b0081e0f97a97b3e2e7ea5bee02f43ae8 (patch) | |
tree | 64b3f9b1b84ba2b7c0819cd409ed743b5f572405 /src/plugins/platforms/cocoa/qcocoaprintersupport.mm | |
parent | 2922f85e707ad086025149fdb7cb1e2608b9e7b2 (diff) |
QtPrintSupport: Move plugin access of QPrinterInfo internals to base
Move all plugin methods requiring access to QPrinterInfo internals
into the plugin base class, and remove the plugin classes as friends
from QPrinterInfo.
Change-Id: Ic527efc681e198abf19e038dd77c36bb8017d049
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.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 | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm index b77d5a20ea..ed436844cb 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm +++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm @@ -128,14 +128,13 @@ QPrinterInfo QCocoaPrinterSupport::printerInfoFromPMPrinter(const PMPrinter &pri if (!printer) 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; + QString name = QCFString::toQString(PMPrinterGetID(printer)); + QString description = QCFString::toQString(PMPrinterGetName(printer)); + QString location = QCFString::toQString(PMPrinterGetLocation(printer)); + CFStringRef cfMakeAndModel; + PMPrinterGetMakeAndModelName(printer, &cfMakeAndModel); + QString makeAndModel = QCFString::toQString(cfMakeAndModel); + bool isDefault = PMPrinterIsDefault(printer); + + return createPrinterInfo(name, description, location, makeAndModel, isDefault, 0); } |