Convert features.cups to QT_[REQUIRE_]CONFIG
Change-Id: I189134b41c4f6e4ac42b5e47ae79338c744b581d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
8632614947
commit
18e5d10426
@ -44,7 +44,9 @@
|
||||
|
||||
#include <private/qpagesetupdialog_p.h>
|
||||
#include <private/qprintdevice_p.h>
|
||||
#if QT_CONFIG(cups)
|
||||
#include <private/qcups_p.h>
|
||||
#endif
|
||||
|
||||
#include "qpainter.h"
|
||||
#include "qprintdialog.h"
|
||||
@ -294,7 +296,7 @@ void QPageSetupWidget::initUnits()
|
||||
// Init the Pages Per Sheet (n-up) combo boxes if using CUPS
|
||||
void QPageSetupWidget::initPagesPerSheet()
|
||||
{
|
||||
#if !defined(QT_NO_CUPS)
|
||||
#if QT_CONFIG(cups)
|
||||
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Top to Bottom"),
|
||||
QVariant::fromValue(QCUPSSupport::LeftToRightTopToBottom));
|
||||
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Bottom to Top"),
|
||||
@ -498,7 +500,7 @@ void QPageSetupWidget::updateWidget()
|
||||
void QPageSetupWidget::setupPrinter() const
|
||||
{
|
||||
m_printer->setPageLayout(m_pageLayout);
|
||||
#if !defined(QT_NO_CUPS)
|
||||
#if QT_CONFIG(cups)
|
||||
QCUPSSupport::PagesPerSheet pagesPerSheet = m_ui.pagesPerSheetCombo->currentData()
|
||||
.value<QCUPSSupport::PagesPerSheet>();
|
||||
QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentData()
|
||||
@ -545,7 +547,7 @@ void QPageSetupWidget::pageOrientationChanged()
|
||||
|
||||
void QPageSetupWidget::pagesPerSheetChanged()
|
||||
{
|
||||
#if !defined(QT_NO_CUPS)
|
||||
#if QT_CONFIG(cups)
|
||||
switch (m_ui.pagesPerSheetCombo->currentData().toInt()) {
|
||||
case QCUPSSupport::OnePagePerSheet:
|
||||
m_pagePreview->setPagePreviewLayout(1, 1);
|
||||
|
@ -64,7 +64,7 @@
|
||||
#include "ui_qprintsettingsoutput.h"
|
||||
#include "ui_qprintwidget.h"
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
#if QT_CONFIG(cups)
|
||||
#include <private/qcups_p.h>
|
||||
#if QT_CONFIG(cupsjobwidget)
|
||||
#include "qcupsjobwidget_p.h"
|
||||
@ -313,7 +313,7 @@ void QPrintDialogPrivate::init()
|
||||
options.grayscale->setIconSize(QSize(32, 32));
|
||||
options.grayscale->setIcon(QIcon(QLatin1String(":/qt-project.org/dialogs/qprintdialog/images/status-gray-scale.png")));
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
#if QT_CONFIG(cups)
|
||||
// Add Page Set widget if CUPS is available
|
||||
options.pageSetCombo->addItem(tr("All Pages"), QVariant::fromValue(QCUPSSupport::AllPages));
|
||||
options.pageSetCombo->addItem(tr("Odd Pages"), QVariant::fromValue(QCUPSSupport::OddPages));
|
||||
@ -435,7 +435,7 @@ void QPrintDialogPrivate::setupPrinter()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
#if QT_CONFIG(cups)
|
||||
// page set
|
||||
if (p->printRange() == QPrinter::AllPages || p->printRange() == QPrinter::PageRange) {
|
||||
//If the application is selecting pages and the first page number is even then need to adjust the odd-even accordingly
|
||||
@ -518,7 +518,7 @@ void QPrintDialogPrivate::updateWidgets()
|
||||
options.printCurrentPage->setVisible(q->isOptionEnabled(QPrintDialog::PrintCurrentPage));
|
||||
options.collate->setVisible(q->isOptionEnabled(QPrintDialog::PrintCollateCopies));
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
#if QT_CONFIG(cups)
|
||||
// Don't display Page Set if only Selection or Current Page are enabled
|
||||
if (!q->isOptionEnabled(QPrintDialog::PrintPageRange)
|
||||
&& (q->isOptionEnabled(QPrintDialog::PrintSelection) || q->isOptionEnabled(QPrintDialog::PrintCurrentPage))) {
|
||||
@ -867,7 +867,7 @@ bool QUnixPrintWidgetPrivate::checkFields()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
#if QT_CONFIG(cups)
|
||||
if (propertiesDialogShown) {
|
||||
QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->m_ui.pagesPerSheetCombo
|
||||
->currentData().value<QCUPSSupport::PagesPerSheet>();
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#include "qprintengine.h"
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QStringList QCUPSSupport::cupsOptionsList(QPrinter *printer)
|
||||
@ -205,5 +203,3 @@ void QCUPSSupport::setPageRange(QPrinter *printer, int pageFrom, int pageTo)
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_CUPS
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include "QtPrintSupport/qprinter.h"
|
||||
#include "QtCore/qdatetime.h"
|
||||
|
||||
#ifndef QT_NO_CUPS
|
||||
QT_REQUIRE_CONFIG(cups);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -150,6 +150,4 @@ Q_DECLARE_METATYPE(QCUPSSupport::PageSet)
|
||||
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheetLayout)
|
||||
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheet)
|
||||
|
||||
#endif // QT_NO_CUPS
|
||||
|
||||
#endif
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qlist.h>
|
||||
|
||||
#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
|
||||
#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
|
||||
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
|
||||
#endif
|
||||
|
||||
@ -245,7 +245,7 @@ public:
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
|
||||
#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
|
||||
|
||||
// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
|
||||
// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
|
||||
|
@ -54,8 +54,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\class QCupsJobWidget
|
||||
@ -212,6 +210,4 @@ QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const
|
||||
return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER / QT_NO_CUPS
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -1,7 +1,7 @@
|
||||
HEADERS += widgets/qprintpreviewwidget.h
|
||||
SOURCES += widgets/qprintpreviewwidget.cpp
|
||||
|
||||
unix:!darwin:qtConfig(cups):qtConfig(cupsjobwidget) {
|
||||
unix:!darwin:qtConfig(cupsjobwidget) {
|
||||
HEADERS += widgets/qcupsjobwidget_p.h
|
||||
SOURCES += widgets/qcupsjobwidget.cpp
|
||||
FORMS += widgets/qcupsjobwidget.ui
|
||||
|
Loading…
x
Reference in New Issue
Block a user