From 264272fb88358c1bc681442bbfd4673de29ef969 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 26 Oct 2011 09:11:48 +0200 Subject: QtPrintSupport: Remove Q_WS_QPA, qpa sections from .pro files. Compile without -qpa. Change-Id: Icfbf733964a7d6db80f8ec706a4b6fe84cd71b4d Reviewed-by: Oliver Wolff --- src/printsupport/kernel/kernel.pri | 8 ++++---- src/printsupport/kernel/qplatformprintersupport_qpa.cpp | 16 ++++++---------- src/printsupport/kernel/qprinter.cpp | 11 ++--------- src/printsupport/kernel/qprinterinfo.cpp | 9 +++------ src/printsupport/kernel/qprinterinfo_p.h | 4 ---- 5 files changed, 15 insertions(+), 33 deletions(-) (limited to 'src/printsupport/kernel') diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri index cf6add54d9..e2fcd8d1dd 100644 --- a/src/printsupport/kernel/kernel.pri +++ b/src/printsupport/kernel/kernel.pri @@ -18,7 +18,7 @@ SOURCES += \ $$PWD/qplatformprintplugin.cpp \ $$PWD/qplatformprintersupport_qpa.cpp -unix:!symbian { +unix { HEADERS += \ $$PWD/qprinterinfo_unix_p.h SOURCES += \ @@ -33,9 +33,9 @@ win32 { LIBS += -lWinspool -lComdlg32 } -x11|qpa:!win32 { +win32 { + DEFINES += QT_NO_CUPS QT_NO_LPR +} else { SOURCES += $$PWD/qcups.cpp HEADERS += $$PWD/qcups_p.h -} else { - DEFINES += QT_NO_CUPS QT_NO_LPR } diff --git a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp index 3c11b3304c..e97ca3fef4 100644 --- a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp +++ b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp @@ -106,26 +106,22 @@ bool QPlatformPrinterSupport::printerInfoIsDefault(const QPrinterInfo &p) int QPlatformPrinterSupport::printerInfoCupsPrinterIndex(const QPrinterInfo &p) { - int i = -1; -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)) || defined(Q_WS_QPA) #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) - if (!p.isNull()) - return i = p.d_func()->cupsPrinterIndex; -#endif -#endif + return p.isNull() ? -1 : p.d_func()->cupsPrinterIndex; +#else Q_UNUSED(p) - return i; + return -1; +#endif } void QPlatformPrinterSupport::setPrinterInfoCupsPrinterIndex(QPrinterInfo *p, int index) { -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)) || defined(Q_WS_QPA) #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) p->d_func()->cupsPrinterIndex = index; -#endif -#endif +#else Q_UNUSED(p) Q_UNUSED(index) +#endif } QT_END_NAMESPACE diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 3271ef8ccc..d748bbddbf 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -159,7 +159,7 @@ Q_PRINTSUPPORT_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientati void QPrinterPrivate::createDefaultEngines() { QPrinter::OutputFormat realOutputFormat = outputFormat; -#if defined (Q_OS_UNIX) && ! defined (Q_WS_MAC) +#if defined (Q_OS_UNIX) if(outputFormat == QPrinter::NativeFormat) { realOutputFormat = QPrinter::PdfFormat; } @@ -167,7 +167,6 @@ void QPrinterPrivate::createDefaultEngines() switch (realOutputFormat) { case QPrinter::NativeFormat: { -#if defined (Q_WS_QPA) QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); if (ps) { printEngine = ps->createNativePrintEngine(printerMode); @@ -177,16 +176,10 @@ void QPrinterPrivate::createDefaultEngines() paintEngine = pdfEngine; printEngine = pdfEngine; } -#elif defined (Q_WS_WIN) - QWin32PrintEngine *winEngine = new QWin32PrintEngine(printerMode); - paintEngine = winEngine; - printEngine = winEngine; -#elif defined (Q_WS_MAC) +#if defined (Q_WS_MAC) QMacPrintEngine *macEngine = new QMacPrintEngine(printerMode); paintEngine = macEngine; printEngine = macEngine; -#elif defined (Q_OS_UNIX) - Q_ASSERT(false); #endif } break; diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index 8958573411..baff9e88dc 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -149,7 +149,7 @@ QString QPrinterInfo::printerName() const */ bool QPrinterInfo::isNull() const { - const Q_D(QPrinterInfo); + Q_D(const QPrinterInfo); return d == &QPrinterInfoPrivate::shared_null; } @@ -158,7 +158,7 @@ bool QPrinterInfo::isNull() const */ bool QPrinterInfo::isDefault() const { - const Q_D(QPrinterInfo); + Q_D(const QPrinterInfo); return d->isDefault; } @@ -172,10 +172,9 @@ bool QPrinterInfo::isDefault() const On Mac OS X 10.3, this function always returns an empty list. */ -#ifdef Q_WS_QPA QList QPrinterInfo::supportedPaperSizes() const { - const Q_D(QPrinterInfo); + Q_D(const QPrinterInfo); if (!isNull() && !d->hasPaperSizes) { d->paperSizes = QPlatformPrinterSupportPlugin::get()->supportedPaperSizes(*this); d->hasPaperSizes = true; @@ -199,8 +198,6 @@ QPrinterInfo QPrinterInfo::defaultPrinter() return QPlatformPrinterSupportPlugin::get()->defaultPrinter(); } -#endif //Q_WS_QPA - QT_END_NAMESPACE #endif // QT_NO_PRINTER diff --git a/src/printsupport/kernel/qprinterinfo_p.h b/src/printsupport/kernel/qprinterinfo_p.h index a3c654e7b7..6c94e4e227 100644 --- a/src/printsupport/kernel/qprinterinfo_p.h +++ b/src/printsupport/kernel/qprinterinfo_p.h @@ -66,10 +66,8 @@ class QPrinterInfoPrivate public: QPrinterInfoPrivate(const QString& name = QString()) : name(name), isDefault(false) -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)) || defined(Q_WS_QPA) #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) , cupsPrinterIndex(0) -#endif #endif , hasPaperSizes(false) {} @@ -81,10 +79,8 @@ public: QString name; bool isDefault; -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)) || defined(Q_WS_QPA) #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) int cupsPrinterIndex; -#endif #endif mutable bool hasPaperSizes; mutable QList paperSizes; -- cgit v1.2.3