QtPrintSupport: Remove Q_WS_QPA, qpa sections from .pro files.

Compile without -qpa.

Change-Id: Icfbf733964a7d6db80f8ec706a4b6fe84cd71b4d
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
bb10
Friedemann Kleint 2011-10-26 09:11:48 +02:00 committed by Qt by Nokia
parent 1b345e8655
commit 264272fb88
8 changed files with 29 additions and 50 deletions

View 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

View 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

View 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)

View 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
}

View 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

View 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;

View 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

View File

@ -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<QPrinter::PaperSize> paperSizes;