summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-10-26 09:11:48 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-26 12:29:03 +0200
commit264272fb88358c1bc681442bbfd4673de29ef969 (patch)
tree426ff7b31cdaef8bedb048605e97a34c9cafffde /src
parent1b345e865599cc7a3d840199be04aebd9bfa1796 (diff)
QtPrintSupport: Remove Q_WS_QPA, qpa sections from .pro files.
Compile without -qpa. Change-Id: Icfbf733964a7d6db80f8ec706a4b6fe84cd71b4d Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/printsupport/dialogs/dialogs.pri18
-rw-r--r--src/printsupport/dialogs/qprintdialog.h10
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp3
-rw-r--r--src/printsupport/kernel/kernel.pri8
-rw-r--r--src/printsupport/kernel/qplatformprintersupport_qpa.cpp16
-rw-r--r--src/printsupport/kernel/qprinter.cpp11
-rw-r--r--src/printsupport/kernel/qprinterinfo.cpp9
-rw-r--r--src/printsupport/kernel/qprinterinfo_p.h4
8 files changed, 29 insertions, 50 deletions
diff --git a/src/printsupport/dialogs/dialogs.pri b/src/printsupport/dialogs/dialogs.pri
index 8d4f7b83ef..68b1737d73 100644
--- a/src/printsupport/dialogs/dialogs.pri
+++ b/src/printsupport/dialogs/dialogs.pri
@@ -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
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index f9017ec59b..06ad99d02e 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -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
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 049a45b1fd..d503623bae 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -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)
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<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
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,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;
};