rpms/qt/devel qt-cups-1.patch, NONE, 1.1 kde-qt-patches.sh, 1.8, 1.9 qt.spec, 1.369, 1.370
Rex Dieter
rdieter at fedoraproject.org
Fri Feb 5 16:16:26 UTC 2010
Author: rdieter
Update of /cvs/pkgs/rpms/qt/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16381
Modified Files:
kde-qt-patches.sh qt.spec
Added Files:
qt-cups-1.patch
Log Message:
* Fri Feb 05 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.1-3
- improve cups support (#523846, kde#180051#c22)
qt-cups-1.patch:
dialogs/qprintdialog_unix.cpp | 28 ++++++++++++++++++++++++++++
painting/qprinter.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+)
--- NEW FILE qt-cups-1.patch ---
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 23f5831..f34277a 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -569,6 +569,34 @@ void QPrintDialogPrivate::setTabs(const QList<QWidget*> &tabWidgets)
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);
+ }
+
+ // 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 --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 4d2b50a..c7ab1b3 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -627,6 +627,48 @@ QPrinter::QPrinter(PrinterMode mode)
&& 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);
+ }
+
+ // 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: kde-qt-patches.sh
===================================================================
RCS file: /cvs/pkgs/rpms/qt/devel/kde-qt-patches.sh,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- kde-qt-patches.sh 9 Jan 2010 23:23:28 -0000 1.8
+++ kde-qt-patches.sh 5 Feb 2010 16:16:26 -0000 1.9
@@ -2,5 +2,5 @@
# unfortunately, requires an already checked-out copy of the git repo
# when switching branches, use something like: git checkout --track remotes/origin/4.6-stable-patched
-git format-patch --output-directory kde-qt-patches v4.6.0..origin/4.6-stable-patched
+git format-patch --output-directory kde-qt-patches v4.6.1..origin/4.6.1-patched
Index: qt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/qt/devel/qt.spec,v
retrieving revision 1.369
retrieving revision 1.370
diff -u -p -r1.369 -r1.370
--- qt.spec 19 Jan 2010 19:12:28 -0000 1.369
+++ qt.spec 5 Feb 2010 16:16:26 -0000 1.370
@@ -13,7 +13,7 @@ Summary: Qt toolkit
Name: qt
Epoch: 1
Version: 4.6.1
-Release: 2%{?dist}
+Release: 3%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@@ -57,6 +57,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-cups-1.patch
# security patches
@@ -403,6 +405,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
# security fixes
@@ -1002,6 +1005,9 @@ fi
%changelog
+* Fri Feb 05 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.1-3
+- improve cups support (#523846, kde#180051#c22)
+
* Tue Jan 19 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.6.1-2
- drop bitmap_font_speed patch, rejected upstream
More information about the scm-commits
mailing list