diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2017-12-05 12:05:32 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2017-12-18 10:10:30 +0000 |
commit | c61810b6f5f645c79adabea35304ac76946c50d0 (patch) | |
tree | c3c009dea0d2de7014183ced2ec951c2241db4a0 /src/plugins/printsupport/cups | |
parent | 8b8e53f7267911c4f406f5c6f54e4a60a0f32112 (diff) |
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 <liang.qi@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/plugins/printsupport/cups')
-rw-r--r-- | src/plugins/printsupport/cups/qppdprintdevice.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |