Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 323257
Collapse All | Expand All

(-)qt-everywhere-opensource-src-4.6.2/src/gui/dialogs/qprintdialog_unix.cpp (+26 lines)
Lines 569-574 Link Here
569
void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
569
void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
570
{
570
{
571
    options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
571
    options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
572
573
    if (cups) {
574
        const ppd_option_t* duplex = cups->ppdOption("Duplex");
575
        if (duplex) {
576
            // copy default ppd duplex to qt dialog
577
            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
578
                options.duplexShort->setChecked(true);
579
            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
580
                options.duplexLong->setChecked(true);
581
            else
582
                options.noDuplex->setChecked(true);
583
        }
584
585
        if (cups->currentPPD()) {
586
            // set default color
587
            if (cups->currentPPD()->color_device)
588
                options.color->setChecked(true);
589
            else
590
                options.grayscale->setChecked(true);
591
        }
592
593
        // set collation
594
        const ppd_option_t *collate = cups->ppdOption("Collate");
595
        if (collate)
596
            options.collate->setChecked(qstrcmp(collate->defchoice, "True")==0);
597
    }
572
}
598
}
573
#endif
599
#endif
574
600
(-)qt-everywhere-opensource-src-4.6.2/src/gui/painting/qprinter.cpp (+38 lines)
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
/*!

Return to bug 323257