Lines 627-632
Link Here
|
627 |
&& d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) { |
627 |
&& d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) { |
628 |
setOutputFormat(QPrinter::PdfFormat); |
628 |
setOutputFormat(QPrinter::PdfFormat); |
629 |
} |
629 |
} |
|
|
630 |
|
631 |
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) |
632 |
// fill in defaults from ppd file |
633 |
QCUPSSupport cups; |
634 |
|
635 |
int printernum = -1; |
636 |
for (int i = 0; i < cups.availablePrintersCount(); i++) { |
637 |
if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name) |
638 |
printernum = i; |
639 |
} |
640 |
if (printernum >= 0) { |
641 |
cups.setCurrentPrinter(printernum); |
642 |
|
643 |
const ppd_option_t* duplex = cups.ppdOption("Duplex"); |
644 |
if (duplex) { |
645 |
// copy default ppd duplex to qt dialog |
646 |
if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0) |
647 |
setDuplex(DuplexShortSide); |
648 |
else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0) |
649 |
setDuplex(DuplexLongSide); |
650 |
else |
651 |
setDuplex(DuplexNone); |
652 |
} |
653 |
|
654 |
if (cups.currentPPD()) { |
655 |
// set default color |
656 |
if (cups.currentPPD()->color_device) |
657 |
setColorMode(Color); |
658 |
else |
659 |
setColorMode(GrayScale); |
660 |
} |
661 |
|
662 |
// set collation |
663 |
const ppd_option_t *collate = cups.ppdOption("Collate"); |
664 |
if (collate) |
665 |
setCollateCopies(qstrcmp(collate->defchoice, "True")==0); |
666 |
} |
667 |
#endif |
630 |
} |
668 |
} |
631 |
|
669 |
|
632 |
/*! |
670 |
/*! |