From 271b484b0081e0f97a97b3e2e7ea5bee02f43ae8 Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 1 Jun 2012 20:33:53 +0100 Subject: 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 Reviewed-by: John Layt --- src/plugins/platforms/cocoa/qcocoaprintersupport.mm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/plugins/platforms') 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); } -- cgit v1.2.3