compile with QT_NO_CUPS

This commit is contained in:
Lars Knoll 2011-05-30 14:43:56 +02:00
parent f190d39197
commit 3a1f80ac92

View File

@ -48,17 +48,23 @@ QT_BEGIN_NAMESPACE
QList<QPrinter::PaperSize> QGenericUnixPrinterSupport::supportedPaperSizes(const QPrinterInfo &printerInfo) const
{
#ifndef QT_NO_CUPS
return QCUPSSupport::getCupsPrinterPaperSizes(QPlatformPrinterSupport::printerInfoCupsPrinterIndex(printerInfo));
#else
return QList<QPrinter::PaperSize>();
#endif
}
QList<QPrinterInfo> QGenericUnixPrinterSupport::availablePrinters()
{
QList<QPrinterInfo> printers;
#ifndef QT_NO_CUPS
foreach (const QCUPSSupport::Printer &p, QCUPSSupport::availableUnixPrinters()) {
QPrinterInfo printer(QPlatformPrinterSupport::printerInfo(p.name, p.isDefault));
QPlatformPrinterSupport::setPrinterInfoCupsPrinterIndex(&printer, p.cupsPrinterIndex);
printers.append(printer);
}
#endif
return printers;
}