diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-08-17 14:20:53 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-08-19 09:16:52 +0200 |
commit | 6d2c5d9ffe255410c34edbb1c1228e68c9d745bd (patch) | |
tree | 22fab8253e9b04f489e2fd2f82dbf773551168e4 /src/printsupport/kernel/qprinter.cpp | |
parent | f4f1b53b9646288d73979f8339a90fbbbcb9eedc (diff) |
Move the printer support backend into it's own plugin
QPlatformIntegration can't have a dependency onto printing
anymore now that printing lives in it's own library. Move
it into a plugin of it's own.
Change-Id: I3ec4b38f4336eb96d92ea799544d17af359c83e1
Reviewed-on: http://codereview.qt.nokia.com/3210
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 72522b38c1..3f169755d8 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -52,7 +52,7 @@ #ifndef QT_NO_PRINTER -#include <private/qguiapplication_p.h> +#include "qplatformprintplugin_qpa.h" #include <QtPrintSupport/QPlatformPrinterSupport> #if defined (Q_WS_WIN) @@ -158,19 +158,24 @@ Q_GUI_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientation, void QPrinterPrivate::createDefaultEngines() { QPrinter::OutputFormat realOutputFormat = outputFormat; -#if !defined (QTOPIA_PRINTENGINE) #if defined (Q_OS_UNIX) && ! defined (Q_WS_MAC) if(outputFormat == QPrinter::NativeFormat) { realOutputFormat = QPrinter::PdfFormat; } #endif -#endif switch (realOutputFormat) { case QPrinter::NativeFormat: { #if defined (Q_WS_QPA) - printEngine = QGuiApplicationPrivate::platformIntegration()->printerSupport()->createNativePrintEngine(printerMode); - paintEngine = QGuiApplicationPrivate::platformIntegration()->printerSupport()->createPaintEngine(printEngine, printerMode); + QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); + if (ps) { + printEngine = ps->createNativePrintEngine(printerMode); + paintEngine = ps->createPaintEngine(printEngine, printerMode); + } else { + QPdfPrintEngine *pdfEngine = new QPdfPrintEngine(printerMode); + paintEngine = pdfEngine; + printEngine = pdfEngine; + } #elif defined (Q_WS_WIN) QWin32PrintEngine *winEngine = new QWin32PrintEngine(printerMode); paintEngine = winEngine; @@ -179,10 +184,6 @@ void QPrinterPrivate::createDefaultEngines() QMacPrintEngine *macEngine = new QMacPrintEngine(printerMode); paintEngine = macEngine; printEngine = macEngine; -#elif defined (QTOPIA_PRINTENGINE) - QtopiaPrintEngine *qwsEngine = new QtopiaPrintEngine(printerMode); - paintEngine = qwsEngine; - printEngine = qwsEngine; #elif defined (Q_OS_UNIX) Q_ASSERT(false); #endif |