forked from pool/libqt5-qtbase
69da80a0af
- 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
124 lines
4.5 KiB
Diff
124 lines
4.5 KiB
Diff
From fb1836898f5f8f88accea92a5ad7adb625694700 Mon Sep 17 00:00:00 2001
|
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
|
Date: Mon, 4 Dec 2017 12:49:12 +0100
|
|
Subject: [PATCH 03/54] Remove QUnixPrintWidgetPrivate::applyPrinterProperties
|
|
|
|
And move it's code to the only place it is called, the QUnixPrintWidget constructor,
|
|
that means we can remove the if that checks if propertiesDialog is not null since
|
|
at that stage we know it is null
|
|
|
|
Change-Id: I81cdaa0505fa6fe64a45c7d1f5c3e277400cbbf7
|
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
|
---
|
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 80 +++++++++++---------------
|
|
1 file changed, 35 insertions(+), 45 deletions(-)
|
|
|
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
|
index 37a562125e..66d37dbec3 100644
|
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
|
@@ -168,8 +168,6 @@ public:
|
|
QUnixPrintWidgetPrivate(QUnixPrintWidget *q, QPrinter *prn);
|
|
~QUnixPrintWidgetPrivate();
|
|
|
|
- /// copy printer properties to the widget
|
|
- void applyPrinterProperties();
|
|
bool checkFields();
|
|
void setupPrinter();
|
|
void setOptionsPane(QPrintDialogPrivate *pane);
|
|
@@ -790,48 +788,6 @@ void QUnixPrintWidgetPrivate::_q_btnBrowseClicked()
|
|
}
|
|
}
|
|
|
|
-void QUnixPrintWidgetPrivate::applyPrinterProperties()
|
|
-{
|
|
- if (printer == nullptr)
|
|
- return;
|
|
- if (printer->outputFileName().isEmpty()) {
|
|
- QString home = QDir::homePath();
|
|
- QString cur = QDir::currentPath();
|
|
- if (home.at(home.length()-1) != QLatin1Char('/'))
|
|
- home += QLatin1Char('/');
|
|
- if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
|
|
- cur += QLatin1Char('/');
|
|
- if (!cur.startsWith(home))
|
|
- cur = home;
|
|
- if (QGuiApplication::platformName() == QLatin1String("xcb")) {
|
|
- if (printer->docName().isEmpty()) {
|
|
- cur += QLatin1String("print.pdf");
|
|
- } else {
|
|
- QRegExp re(QString::fromLatin1("(.*)\\.\\S+"));
|
|
- if (re.exactMatch(printer->docName()))
|
|
- cur += re.cap(1);
|
|
- else
|
|
- cur += printer->docName();
|
|
- cur += QLatin1String(".pdf");
|
|
- }
|
|
- } // xcb
|
|
-
|
|
- widget.filename->setText(cur);
|
|
- }
|
|
- else
|
|
- widget.filename->setText( printer->outputFileName() );
|
|
- QString printerName = printer->printerName();
|
|
- if (!printerName.isEmpty()) {
|
|
- const int i = widget.printers->findText(printerName);
|
|
- if (i >= 0)
|
|
- widget.printers->setCurrentIndex(i);
|
|
- }
|
|
- // PDF printer not added to the dialog yet, we'll handle those cases in QUnixPrintWidgetPrivate::updateWidget
|
|
-
|
|
- if (propertiesDialog)
|
|
- propertiesDialog->applyPrinterProperties(printer);
|
|
-}
|
|
-
|
|
#if QT_CONFIG(messagebox)
|
|
bool QUnixPrintWidgetPrivate::checkFields()
|
|
{
|
|
@@ -951,7 +907,41 @@ void QUnixPrintWidgetPrivate::setupPrinter()
|
|
QUnixPrintWidget::QUnixPrintWidget(QPrinter *printer, QWidget *parent)
|
|
: QWidget(parent), d(new QUnixPrintWidgetPrivate(this, printer))
|
|
{
|
|
- d->applyPrinterProperties();
|
|
+ if (printer == nullptr)
|
|
+ return;
|
|
+ if (printer->outputFileName().isEmpty()) {
|
|
+ QString home = QDir::homePath();
|
|
+ QString cur = QDir::currentPath();
|
|
+ if (!home.endsWith(QLatin1Char('/')))
|
|
+ home += QLatin1Char('/');
|
|
+ if (!cur.startsWith(home))
|
|
+ cur = home;
|
|
+ else if (!cur.endsWith(QLatin1Char('/')))
|
|
+ cur += QLatin1Char('/');
|
|
+ if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
|
|
+ if (printer->docName().isEmpty()) {
|
|
+ cur += QStringLiteral("print.pdf");
|
|
+ } else {
|
|
+ const QRegExp re(QStringLiteral("(.*)\\.\\S+"));
|
|
+ if (re.exactMatch(printer->docName()))
|
|
+ cur += re.cap(1);
|
|
+ else
|
|
+ cur += printer->docName();
|
|
+ cur += QStringLiteral(".pdf");
|
|
+ }
|
|
+ } // xcb
|
|
+
|
|
+ d->widget.filename->setText(cur);
|
|
+ }
|
|
+ else
|
|
+ d->widget.filename->setText(printer->outputFileName());
|
|
+ const QString printerName = printer->printerName();
|
|
+ if (!printerName.isEmpty()) {
|
|
+ const int i = d->widget.printers->findText(printerName);
|
|
+ if (i >= 0)
|
|
+ d->widget.printers->setCurrentIndex(i);
|
|
+ }
|
|
+ // PDF printer not added to the dialog yet, we'll handle those cases in QUnixPrintWidgetPrivate::updateWidget
|
|
}
|
|
|
|
/*! \internal
|
|
--
|
|
2.15.1
|
|
|