QtPrintSupport: Remove Q_WS_QPA, qpa sections from .pro files.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Wed, 26 Oct 2011 07:11:48 +0000 (09:11 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 26 Oct 2011 10:29:03 +0000 (12:29 +0200)
Compile without -qpa.

Change-Id: Icfbf733964a7d6db80f8ec706a4b6fe84cd71b4d
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
src/printsupport/dialogs/dialogs.pri
src/printsupport/dialogs/qprintdialog.h
src/printsupport/dialogs/qprintdialog_unix.cpp
src/printsupport/kernel/kernel.pri
src/printsupport/kernel/qplatformprintersupport_qpa.cpp
src/printsupport/kernel/qprinter.cpp
src/printsupport/kernel/qprinterinfo.cpp
src/printsupport/kernel/qprinterinfo_p.h

index 8d4f7b8..68b1737 100644 (file)
@@ -9,10 +9,10 @@ HEADERS += \
         dialogs/qprintdialog.h \
         dialogs/qprintpreviewdialog.h
 
-!qpa:mac {
+# ### fixme
+false {
     OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
                          dialogs/qprintdialog_mac.mm
-
 }
 
 win32 {
@@ -20,13 +20,13 @@ win32 {
                dialogs/qprintdialog_win.cpp
 }
 
-!mac:!symbian:unix|qpa:!win32 {
-        HEADERS += dialogs/qpagesetupdialog_unix_p.h
-        SOURCES += dialogs/qprintdialog_unix.cpp \
-                   dialogs/qpagesetupdialog_unix.cpp
-        FORMS += dialogs/qprintsettingsoutput.ui \
-        dialogs/qprintwidget.ui \
-        dialogs/qprintpropertieswidget.ui
+unix {
+    HEADERS += dialogs/qpagesetupdialog_unix_p.h
+    SOURCES += dialogs/qprintdialog_unix.cpp \
+               dialogs/qpagesetupdialog_unix.cpp
+    FORMS += dialogs/qprintsettingsoutput.ui \
+    dialogs/qprintwidget.ui \
+    dialogs/qprintpropertieswidget.ui
 }
 
 INCLUDEPATH += $$PWD
index f9017ec..06ad99d 100644 (file)
@@ -56,7 +56,7 @@ class QPrintDialogPrivate;
 class QPushButton;
 class QPrinter;
 
-#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN)
+#if defined (Q_OS_UNIX)
 class QUnixPrintWidgetPrivate;
 
 class Q_PRINTSUPPORT_EXPORT QUnixPrintWidget : public QWidget
@@ -91,7 +91,7 @@ public:
     ~QPrintDialog();
 
     int exec();
-#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC)
+#if defined (Q_OS_UNIX)
     virtual void accept();
 #endif
     void done(int result);
@@ -101,7 +101,7 @@ public:
     void setOptions(PrintDialogOptions options);
     PrintDialogOptions options() const;
 
-#if defined(Q_OS_UNIX) || defined(Q_WS_MAC) || defined(Q_OS_WIN)
+#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
     void setVisible(bool visible);
 #endif
 
@@ -137,10 +137,10 @@ Q_SIGNALS:
 private:
 #ifndef QTOPIA_PRINTDIALOG
     Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool))
-#if defined (Q_OS_UNIX) && !defined (Q_OS_MAC)
+#if defined (Q_OS_UNIX)
     Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
 #endif
-# if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) && !defined(QT_NO_MESSAGEBOX)
+# if defined(Q_OS_UNIX) && !defined(QT_NO_MESSAGEBOX)
     Q_PRIVATE_SLOT(d_func(), void _q_checkFields())
 # endif
 #else // QTOPIA_PRINTDIALOG
index 049a45b..d503623 100644 (file)
@@ -140,7 +140,6 @@ public:
     QPushButton *collapseButton;
 };
 
-#if defined (Q_OS_UNIX)
 class QUnixPrintWidgetPrivate
 {
 public:
@@ -1005,8 +1004,6 @@ void QUnixPrintWidget::updatePrinter()
     d->setupPrinter();
 }
 
-#endif
-
 ////////////////////////////////////////////////////////////////////////////////
 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
 
index cf6add5..e2fcd8d 100644 (file)
@@ -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
 }
index 3c11b33..e97ca3f 100644 (file)
@@ -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
index 3271ef8..d748bbd 100644 (file)
@@ -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;
index 8958573..baff9e8 100644 (file)
@@ -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<QPrinter::PaperSize> 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
index a3c654e..6c94e4e 100644 (file)
@@ -66,11 +66,9 @@ 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)
     {}
     ~QPrinterInfoPrivate()
@@ -81,11 +79,9 @@ 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<QPrinter::PaperSize> paperSizes;
 };