From 5e2f583a67c75c1c03e213467bb56207e5084279 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 21 Dec 2017 16:55:42 +0100 Subject: CUPS: Fix conflict handling The previous code assumed that ppdMarkOption returning non zero (i.e. it has conflicts) also meant that the option wasn't applied at the ppd level, but it actually is. What we need to do is after calling ppdMarkOption parse the tree again looking to see if any option is conflicting and mark it as such in the UI. Change-Id: I836f1902d14dc8c176bb06776471cbf4ed11786f Reviewed-by: Andy Shaw --- src/plugins/printsupport/cups/qppdprintdevice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/printsupport') diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp index 8aed8c544b..9c4b699c3e 100644 --- a/src/plugins/printsupport/cups/qppdprintdevice.cpp +++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp @@ -443,8 +443,10 @@ bool QPpdPrintDevice::setProperty(QPrintDevice::PrintDevicePropertyKey key, cons { if (key == PDPK_PpdOption) { const QStringList values = value.toStringList(); - if (values.count() == 2) - return ppdMarkOption(m_ppd, values[0].toLatin1(), values[1].toLatin1()) == 0; + if (values.count() == 2) { + ppdMarkOption(m_ppd, values[0].toLatin1(), values[1].toLatin1()); + return true; + } } return false; -- cgit v1.2.3