summaryrefslogtreecommitdiffstats
path: root/src/plugins/printsupport
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2017-12-21 16:55:42 +0100
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2018-01-05 15:38:35 +0000
commit5e2f583a67c75c1c03e213467bb56207e5084279 (patch)
tree93e11c9be1849690eea39dafb1bd8373b9f7dbf1 /src/plugins/printsupport
parent5e9e4ccdc363297f70d4ebfbbb3e279670eca553 (diff)
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 <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/printsupport')
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.cpp6
1 files changed, 4 insertions, 2 deletions
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;