From f1aa2ee512ef9a06bc2a86b080d6ba3864f46539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 3 Nov 2017 13:40:48 +0100 Subject: [PATCH] macOS: Disable CUPS PPD deprecation warnings for QCocoaPrintDevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We're not going to rewrite this code until we can also share the rewrite with QPpdPrintDevice, which can only happen once we drop support for RHEL 6, which still ships CUPS 1.4. Until then, silence these deprecation warnings so that they don't add noise to other potential build warnings/issues. This matches the approach taken by Chromium in crbug.com/622493. Task-number: QTBUG-56545 Change-Id: Ia308ae1e8064dc046745350b0be3992d02f2b760 Reviewed-by: Andy Shaw Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaprintdevice.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm index 39fcf285ed..bfe6cd09b6 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm +++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm @@ -46,6 +46,15 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_PRINTER +// The CUPS PPD APIs were deprecated in CUPS 1.6/macOS 10.8, but +// as long as we're supporting RHEL 6, which still ships CUPS 1.4 +// we're not going to rewrite this, as we want to share the code +// between macOS and Linux for the CUPS-bits. See discussion in +// https://bugreports.qt.io/browse/QTBUG-56545 +#pragma message "Disabling CUPS PPD deprecation warnings. This should be fixed once we drop support for RHEL6 (QTBUG-56545)" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + static QPrint::DuplexMode macToDuplexMode(const PMDuplexMode &mode) { if (mode == kPMDuplexTumble) @@ -474,6 +483,8 @@ PMPaper QCocoaPrintDevice::macPaper(const QPageSize &pageSize) const return paper; } +#pragma clang diagnostic pop + #endif // QT_NO_PRINTER QT_END_NAMESPACE