[arch-commits] Commit in qt/trunk (PKGBUILD improve-cups-support.patch)

Andrea Scarpino andrea at archlinux.org
Thu Mar 8 03:51:48 EST 2012


    Date: Thursday, March 8, 2012 @ 03:51:48
  Author: andrea
Revision: 152663

Apply non upstream patch to improve cups support in Qt/Kde apps (FS#28381)

Added:
  qt/trunk/improve-cups-support.patch
Modified:
  qt/trunk/PKGBUILD

----------------------------+
 PKGBUILD                   |   11 ++++-
 improve-cups-support.patch |   84 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-03-08 01:36:52 UTC (rev 152662)
+++ PKGBUILD	2012-03-08 08:51:48 UTC (rev 152663)
@@ -5,7 +5,7 @@
 pkgbase=qt
 pkgname=('qt' 'qt-private-headers')
 pkgver=4.8.0
-pkgrel=5
+pkgrel=6
 arch=('i686' 'x86_64')
 url='http://qt-project.org/'
 license=('GPL3' 'LGPL')
@@ -20,7 +20,8 @@
         'qtconfig.desktop'
         'fix-qgraphicsscene-regression.patch'
         'improved-filter-event.patch'
-        'qurl-backward-compatibility.patch')
+        'qurl-backward-compatibility.patch'
+        'improve-cups-support')
 md5sums=('e8a5fdbeba2927c948d9f477a6abe904'
          'fc211414130ab2764132e7370f8e5caa'
          '85179f5e0437514f8639957e1d8baf62'
@@ -28,7 +29,8 @@
          '6b771c8a81dd90b45e8a79afa0e5bbfd'
          'c2e91fc028250a590e76effe234468e2'
          '444ebeb716d7c7379835efb8aa88e6c8'
-         '7bc255a36733d0fbc80c1902ade4beca')
+         '7bc255a36733d0fbc80c1902ade4beca'
+         'c439c7731c25387352d8453ca7574971')
 
 build() {
   cd "${srcdir}"/${_pkgfqn}
@@ -39,6 +41,9 @@
   patch -p1 -i "${srcdir}"/improved-filter-event.patch
   patch -p1 -i "${srcdir}"/qurl-backward-compatibility.patch
 
+  # (FS#28381) (KDEBUG#180051)
+  patch -p1 -i "${srcdir}"/improve-cups-support.patch
+
   export QT4DIR="${srcdir}"/${_pkgfqn}
   export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
 

Added: improve-cups-support.patch
===================================================================
--- improve-cups-support.patch	                        (rev 0)
+++ improve-cups-support.patch	2012-03-08 08:51:48 UTC (rev 152663)
@@ -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
+ }
+ 
+ /*!



More information about the arch-commits mailing list