~ubuntu-branches/ubuntu/utopic/qt4-x11/utopic

« back to all changes in this revision

Viewing changes to src/gui/painting/qprinter.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Jonathan Riddell
  • Date: 2012-08-24 00:16:10 UTC
  • Revision ID: package-import@ubuntu.com-20120824001610-148fm13f7hq4cl96
Tags: 4:4.8.2-0ubuntu6
[ Rohan Garg ]
* Transition to libtiff-dev 

[ Jonathan Riddell ]
* Add kubuntu_37_cups_settings.diff from https://bugs.kde.org/180051 and
  QTBUG-25372 use CUPS settings in the print dialogue. LP: #905147

Show diffs side-by-side

added added

removed removed

Lines of Context:
609
609
               && d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) {
610
610
        setOutputFormat(QPrinter::PdfFormat);
611
611
    }
 
612
 
 
613
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
 
614
    // fill in defaults from ppd file
 
615
    QCUPSSupport cups;
 
616
 
 
617
    int printernum = -1;
 
618
    for (int i = 0; i < cups.availablePrintersCount(); i++) {
 
619
        if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name)
 
620
            printernum = i;
 
621
    }
 
622
    if (printernum >= 0) {
 
623
        cups.setCurrentPrinter(printernum);
 
624
 
 
625
        const ppd_option_t* duplex = cups.ppdOption("Duplex");
 
626
        if (duplex) {
 
627
            // copy default ppd duplex to qt dialog
 
628
            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
 
629
                setDuplex(DuplexShortSide);
 
630
            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
 
631
                setDuplex(DuplexLongSide);
 
632
            else
 
633
                setDuplex(DuplexNone);
 
634
        }
 
635
 
 
636
        if (cups.currentPPD()) {
 
637
            // set default color
 
638
            if (cups.currentPPD()->color_device)
 
639
                setColorMode(Color);
 
640
            else
 
641
                setColorMode(GrayScale);
 
642
        }
 
643
 
 
644
        // set collation
 
645
        const ppd_option_t *collate = cups.ppdOption("Collate");
 
646
        if (collate)
 
647
            setCollateCopies(qstrcmp(collate->defchoice, "True")==0);
 
648
    }
 
649
#endif
612
650
}
613
651
 
614
652
/*!