rpms/qt/F-13 qt-everywhere-opensource-src-4.6.2-cups.patch, 1.2, 1.3 qt.spec, 1.387, 1.388

Kevin Kofler kkofler at fedoraproject.org
Thu Apr 29 07:26:41 UTC 2010


Author: kkofler

Update of /cvs/pkgs/rpms/qt/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv4052/F-13

Modified Files:
	qt.spec 
Added Files:
	qt-everywhere-opensource-src-4.6.2-cups.patch 
Log Message:
* Thu Apr 29 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.6.2-16
- restore qt-everywhere-opensource-src-4.6.2-cups.patch (#586725)

qt-everywhere-opensource-src-4.6.2-cups.patch:
 dialogs/qprintdialog_unix.cpp |   26 ++++++++++++++++++++++++++
 painting/qprinter.cpp         |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)

Index: qt-everywhere-opensource-src-4.6.2-cups.patch
===================================================================
RCS file: qt-everywhere-opensource-src-4.6.2-cups.patch
diff -N qt-everywhere-opensource-src-4.6.2-cups.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ qt-everywhere-opensource-src-4.6.2-cups.patch	29 Apr 2010 07:26:41 -0000	1.3
@@ -0,0 +1,84 @@
+diff -ur qt-everywhere-opensource-src-4.6.2/src/gui/dialogs/qprintdialog_unix.cpp qt-everywhere-opensource-src-4.6.2-cups/src/gui/dialogs/qprintdialog_unix.cpp
+--- qt-everywhere-opensource-src-4.6.2/src/gui/dialogs/qprintdialog_unix.cpp	2010-02-11 16:55:22.000000000 +0100
++++ qt-everywhere-opensource-src-4.6.2-cups/src/gui/dialogs/qprintdialog_unix.cpp	2010-02-28 04:34:16.000000000 +0100
+@@ -569,6 +569,32 @@
+ void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
+ {
+     options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
++
++    if (cups) {
++        const ppd_option_t* duplex = cups->ppdOption("Duplex");
++        if (duplex) {
++            // copy default ppd duplex to qt dialog
++            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
++                options.duplexShort->setChecked(true);
++            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
++                options.duplexLong->setChecked(true);
++            else
++                options.noDuplex->setChecked(true);
++        }
++
++        if (cups->currentPPD()) {
++            // set default color
++            if (cups->currentPPD()->color_device)
++                options.color->setChecked(true);
++            else
++                options.grayscale->setChecked(true);
++        }
++
++        // set collation
++        const ppd_option_t *collate = cups->ppdOption("Collate");
++        if (collate)
++            options.collate->setChecked(qstrcmp(collate->defchoice, "True")==0);
++    }
+ }
+ #endif
+ 
+diff -ur qt-everywhere-opensource-src-4.6.2/src/gui/painting/qprinter.cpp qt-everywhere-opensource-src-4.6.2-cups/src/gui/painting/qprinter.cpp
+--- qt-everywhere-opensource-src-4.6.2/src/gui/painting/qprinter.cpp	2010-02-11 16:55:22.000000000 +0100
++++ qt-everywhere-opensource-src-4.6.2-cups/src/gui/painting/qprinter.cpp	2010-02-28 04:55:15.000000000 +0100
+@@ -627,6 +627,44 @@
+                && d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) {
+         setOutputFormat(QPrinter::PdfFormat);
+     }
++
++#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
++    // fill in defaults from ppd file
++    QCUPSSupport cups;
++
++    int printernum = -1;
++    for (int i = 0; i < cups.availablePrintersCount(); i++) {
++        if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name)
++            printernum = i;
++    }
++    if (printernum >= 0) {
++        cups.setCurrentPrinter(printernum);
++
++        const ppd_option_t* duplex = cups.ppdOption("Duplex");
++        if (duplex) {
++            // copy default ppd duplex to qt dialog
++            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
++                setDuplex(DuplexShortSide);
++            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
++                setDuplex(DuplexLongSide);
++            else
++                setDuplex(DuplexNone);
++        }
++
++        if (cups.currentPPD()) {
++            // set default color
++            if (cups.currentPPD()->color_device)
++                setColorMode(Color);
++            else
++                setColorMode(GrayScale);
++        }
++
++        // set collation
++        const ppd_option_t *collate = cups.ppdOption("Collate");
++        if (collate)
++            setCollateCopies(qstrcmp(collate->defchoice, "True")==0);
++    }
++#endif
+ }
+ 
+ /*!


Index: qt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/qt/F-13/qt.spec,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -p -r1.387 -r1.388
--- qt.spec	28 Apr 2010 14:30:33 -0000	1.387
+++ qt.spec	29 Apr 2010 07:26:41 -0000	1.388
@@ -56,6 +56,8 @@ Patch53: qt-x11-opensource-src-4.5.0-fix
 # fix invalid assumptions about mysql_config --libs
 # http://bugzilla.redhat.com/440673
 Patch54: qt-x11-opensource-src-4.5.1-mysql_config.patch
+# http://bugs.kde.org/show_bug.cgi?id=180051#c22
+Patch55: qt-everywhere-opensource-src-4.6.2-cups.patch
 # fix type cast issue on s390x
 Patch56: qt-everywhere-opensource-src-4.6.2-webkit-s390x.patch
 # fix type cast issue on sparc64
@@ -420,6 +422,7 @@ Qt libraries used for drawing widgets an
 %patch53 -p1 -b .qatomic-inline-asm
 ## TODO: upstream me
 %patch54 -p1 -b .mysql_config
+%patch55 -p1 -b .cups-1
 %patch56 -p1 -b .typecast_s390x
 %patch57 -p1 -b .typecast_sparc64
 
@@ -1039,6 +1042,9 @@ fi
 
 
 %changelog
+* Thu Apr 29 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.6.2-16
+- restore qt-everywhere-opensource-src-4.6.2-cups.patch (#586725)
+
 * Wed Apr 28 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.2-15
 - own %%{_qt4_plugindir}/crypto
 



More information about the scm-commits mailing list