1
0
forked from pool/libqt5-qtbase
libqt5-qtbase/0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
Dominique Leuenberger 69da80a0af Accepting request 558896 from KDE:Qt5
- Add 0001-Fix-custom-page-size-handling-in-the-Unix-print-dial.patch
  to fix custom page size handling in the Unix print dialog (QTBUG-58733) 

- Add patches from upstream to reintroduce the advanced tab in
  the Qt printer properties dialog:
  0001-Remove-QPrintDialogPrivate-applyPrinterProperties-no.patch 
  0002-Remove-QUnixPrintWidgetPrivate-applyPrinterPropertie.patch
  0003-Remove-QPrintPropertiesDialog-applyPrinterProperties.patch
  0004-Remove-QCupsJobWidget-setPrinter.patch
  0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
  0006-Remove-QPageSetupWidget-selectPrinter.patch
  0007-Introduce-QPrintDevice-property-setProperty.patch
  0008-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.patch
  0009-QPlatformPrintDevice-use-QVector-not-QList-in-the-AP.patch
  0010-Reintroduce-the-Advanced-tab-in-the-QPrintProperties.patch
  0011-QtPrintSupport-Fix-build.patch 
- Small change in 0001-Add-remote-print-queue-support.patch so
  0007-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.patch
  applies cleanly.

- Update the license tag (boo#967696)

- Update to 5.10.0 final
  * New bugfix release

- Update to 5.10.0 RC 2
  * New bugfix release

- Update to 5.10.0 RC 1
  * New bugfix release

OBS-URL: https://build.opensuse.org/request/show/558896
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=71
2017-12-23 11:15:29 +00:00

92 lines
3.6 KiB
Diff

From 072dd59de771d0c942afd68260251be71bd59542 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Mon, 4 Dec 2017 13:05:02 +0100
Subject: [PATCH 06/54] Remove QPrintPropertiesDialog::selectPrinter
It is only ever called after the constructor, so merge the code
Change-Id: I5c75a2cd367af401b41920f51754a64dc6c6eb40
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
---
src/printsupport/dialogs/qprintdialog_unix.cpp | 30 +++++++++++++-------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 8c9997d572..c7f7488917 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -124,11 +124,10 @@ class QPrintPropertiesDialog : public QDialog
{
Q_OBJECT
public:
- QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent = nullptr);
+ QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
+ const QString &printerName, QAbstractPrintDialog *parent = nullptr);
~QPrintPropertiesDialog();
- void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
-
void setupPrinter() const;
private:
@@ -234,7 +233,8 @@ public:
*/
-QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent)
+QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
+ const QString &printerName, QAbstractPrintDialog *parent)
: QDialog(parent)
{
setWindowTitle(tr("Printer Properties"));
@@ -249,6 +249,7 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrint
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
widget.pageSetup->setPrinter(printer);
+ widget.pageSetup->selectPrinter(outputFormat, printerName);
#if QT_CONFIG(cupsjobwidget)
m_jobOptions = new QCupsJobWidget(printer);
@@ -268,11 +269,6 @@ void QPrintPropertiesDialog::setupPrinter() const
#endif
}
-void QPrintPropertiesDialog::selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName)
-{
- widget.pageSetup->selectPrinter(outputFormat, printerName);
-}
-
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@@ -838,16 +834,20 @@ void QUnixPrintWidgetPrivate::setupPrinterProperties()
if (propertiesDialog)
delete propertiesDialog;
- propertiesDialog = new QPrintPropertiesDialog(q->printer(), q);
- propertiesDialog->setResult(QDialog::Rejected);
- propertiesDialogShown = false;
+ QPrinter::OutputFormat outputFormat;
+ QString printerName;
if (q->isOptionEnabled(QPrintDialog::PrintToFile)
&& (widget.printers->currentIndex() == widget.printers->count() - 1)) {// PDF
- propertiesDialog->selectPrinter(QPrinter::PdfFormat, QString());
+ outputFormat = QPrinter::PdfFormat;
+ } else {
+ outputFormat = QPrinter::NativeFormat;
+ printerName = widget.printers->currentText();
}
- else
- propertiesDialog->selectPrinter(QPrinter::NativeFormat, widget.printers->currentText());
+
+ propertiesDialog = new QPrintPropertiesDialog(q->printer(), outputFormat, printerName, q);
+ propertiesDialog->setResult(QDialog::Rejected);
+ propertiesDialogShown = false;
}
void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked()
--
2.15.1