1
0
forked from pool/libqt5-qtbase
libqt5-qtbase/0008-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.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

98 lines
3.5 KiB
Diff

From e79efe94e3e77ee035ff7d046158a577759f8c7c Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Mon, 4 Dec 2017 14:05:55 +0100
Subject: [PATCH 38/54] Allow access to ppd file and ppdMarkOption via
QPpdPrintDevice::property/setProperty
Change-Id: I47b49b52121950fa8e3ea7a056974d9f3033490f
Reviewed-by: Liang Qi <liang.qi@qt.io>
---
src/plugins/printsupport/cups/qppdprintdevice.cpp | 21 +++++++++++++++++++++
src/plugins/printsupport/cups/qppdprintdevice.h | 3 +++
src/printsupport/kernel/qcups_p.h | 3 +++
src/printsupport/kernel/qprint_p.h | 1 +
4 files changed, 28 insertions(+)
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp
index 9efa83d409..ad829df23d 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.cpp
+++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp
@@ -42,6 +42,8 @@
#include <QtCore/QMimeDatabase>
#include <qdebug.h>
+#include "private/qcups_p.h" // Only needed for PDPK_*
+
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
#include <cups/language.h>
#endif
@@ -421,6 +423,25 @@ QPrint::ColorMode QPpdPrintDevice::defaultColorMode() const
return QPrint::GrayScale;
}
+QVariant QPpdPrintDevice::property(QPrintDevice::PrintDevicePropertyKey key) const
+{
+ if (key == PDPK_PpdFile)
+ return QVariant::fromValue<ppd_file_t *>(m_ppd);
+
+ return QVariant();
+}
+
+bool QPpdPrintDevice::setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value)
+{
+ if (key == PDPK_PpdOption) {
+ const QStringList values = value.toStringList();
+ if (values.count() == 2)
+ return ppdMarkOption(m_ppd, values[0].toLatin1(), values[1].toLatin1()) == 0;
+ }
+
+ return false;
+}
+
#ifndef QT_NO_MIMETYPE
void QPpdPrintDevice::loadMimeTypes() const
{
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.h b/src/plugins/printsupport/cups/qppdprintdevice.h
index 3cd7518b14..2e4dd3ab3b 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.h
+++ b/src/plugins/printsupport/cups/qppdprintdevice.h
@@ -89,6 +89,9 @@ public:
QPrint::ColorMode defaultColorMode() const Q_DECL_OVERRIDE;
+ QVariant property(QPrintDevice::PrintDevicePropertyKey key) const Q_DECL_OVERRIDE;
+ bool setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value) Q_DECL_OVERRIDE;
+
protected:
void loadPageSizes() const Q_DECL_OVERRIDE;
void loadResolutions() const Q_DECL_OVERRIDE;
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index 780115e350..b67390c4ed 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -67,6 +67,9 @@ QT_BEGIN_NAMESPACE
// removed from the dialogs.
#define PPK_CupsOptions QPrintEngine::PrintEnginePropertyKey(0xfe00)
+#define PDPK_PpdFile QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase)
+#define PDPK_PpdOption QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 1)
+
class Q_PRINTSUPPORT_EXPORT QCUPSSupport
{
public:
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index 280c2d7608..4956775461 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -59,6 +59,7 @@
#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
+Q_DECLARE_METATYPE(ppd_file_t *)
#endif
QT_BEGIN_NAMESPACE
--
2.15.1