summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2012-06-01 20:33:53 +0100
committerQt by Nokia <qt-info@nokia.com>2012-06-08 13:33:50 +0200
commit271b484b0081e0f97a97b3e2e7ea5bee02f43ae8 (patch)
tree64b3f9b1b84ba2b7c0819cd409ed743b5f572405 /src/printsupport/kernel/qplatformprintersupport_qpa.cpp
parent2922f85e707ad086025149fdb7cb1e2608b9e7b2 (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/printsupport/kernel/qplatformprintersupport_qpa.cpp')
-rw-r--r--src/printsupport/kernel/qplatformprintersupport_qpa.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
index 7bf2b291d0..d6ffd9b7fc 100644
--- a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
+++ b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
@@ -107,14 +107,22 @@ QPrinterInfo QPlatformPrinterSupport::printerInfo(const QString &printerName)
return QPrinterInfo();
}
-void QPlatformPrinterSupport::setPrinterInfoDefault(QPrinterInfo *p, bool isDefault)
+int QPlatformPrinterSupport::printerIndex(const QPrinterInfo &printer)
{
- p->d_func()->isDefault = isDefault;
+ return printer.d_func()->index;
}
-bool QPlatformPrinterSupport::printerInfoIsDefault(const QPrinterInfo &p)
+QPrinterInfo QPlatformPrinterSupport::createPrinterInfo(const QString &name, const QString &description,
+ const QString &location, const QString &makeAndModel,
+ bool isDefault, int index)
{
- return p.d_func()->isDefault;
+ QPrinterInfo printer(name);
+ printer.d_func()->description = description;
+ printer.d_func()->location = location;
+ printer.d_func()->makeAndModel = makeAndModel;
+ printer.d_func()->isDefault = isDefault;
+ printer.d_func()->index = index;
+ return printer;
}
/*