From c61810b6f5f645c79adabea35304ac76946c50d0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 5 Dec 2017 12:05:32 +0100 Subject: [PATCH] CUPS: Fix lpoptions file not being taken into account This is actually two fixes. * We need to call cupsMarkOptions * CUPS differentiates between the "" and the nullptr instance, so we need to change the call to cupsGetNamedDest accordingly Change-Id: If2692e405b6b71f8ee91362e6e72eabd9202d704 Reviewed-by: Liang Qi Reviewed-by: Frederik Gladhorn --- src/plugins/printsupport/cups/qppdprintdevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp index ad829df23d..021d040ad0 100644 --- a/src/plugins/printsupport/cups/qppdprintdevice.cpp +++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp @@ -473,7 +473,7 @@ void QPpdPrintDevice::loadPrinter() } // Get the print instance and PPD file - m_cupsDest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, m_cupsName, m_cupsInstance); + m_cupsDest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, m_cupsName, m_cupsInstance.isNull() ? nullptr : m_cupsInstance.constData()); if (m_cupsDest) { const char *ppdFile = cupsGetPPD(m_cupsName); if (ppdFile) { @@ -482,6 +482,7 @@ void QPpdPrintDevice::loadPrinter() } if (m_ppd) { ppdMarkDefaults(m_ppd); + cupsMarkOptions(m_ppd, m_cupsDest->num_options, m_cupsDest->options); } else { cupsFreeDests(1, m_cupsDest); m_cupsDest = 0;