summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2017-12-06 12:00:00 +0100
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2017-12-18 15:24:05 +0000
commit2831fa76655c614ed3df0816401514950e79b5e6 (patch)
tree6bb33f5b24224d567ec4185f5ef9c7e020571e9d /src
parent83538a360e246ac2242977015e4a374a9f0e21b8 (diff)
CUPS: Use printer job-billing as default instead of the empty string
This also reads the job-billing from lpoptions if set there for the particular printer Change-Id: Ia4a6961de504005b8dcd9209da0624e9ae9ef7e4 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.cpp2
-rw-r--r--src/printsupport/kernel/qcups_p.h1
-rw-r--r--src/printsupport/widgets/qcupsjobwidget.cpp6
3 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp
index e11d301bd8..0fd6f5f096 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.cpp
+++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp
@@ -431,6 +431,8 @@ QVariant QPpdPrintDevice::property(QPrintDevice::PrintDevicePropertyKey key) con
return printerOption(QStringLiteral("job-priority"));
else if (key == PDPK_CupsJobSheets)
return printerOption(QStringLiteral("job-sheets"));
+ else if (key == PDPK_CupsJobBilling)
+ return printerOption(QStringLiteral("job-billing"));
return QVariant();
}
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index 906a5486c0..c6bbacc8d9 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -71,6 +71,7 @@ QT_BEGIN_NAMESPACE
#define PDPK_PpdOption QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 1)
#define PDPK_CupsJobPriority QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 2)
#define PDPK_CupsJobSheets QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 3)
+#define PDPK_CupsJobBilling QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 4)
class Q_PRINTSUPPORT_EXPORT QCUPSSupport
{
diff --git a/src/printsupport/widgets/qcupsjobwidget.cpp b/src/printsupport/widgets/qcupsjobwidget.cpp
index 4535f756c5..adaaff831a 100644
--- a/src/printsupport/widgets/qcupsjobwidget.cpp
+++ b/src/printsupport/widgets/qcupsjobwidget.cpp
@@ -139,7 +139,11 @@ QTime QCupsJobWidget::jobHoldTime() const
void QCupsJobWidget::initJobBilling()
{
- setJobBilling(QString());
+ QString jobBilling;
+ if (m_printDevice)
+ jobBilling = m_printDevice->property(PDPK_CupsJobBilling).toString();
+
+ setJobBilling(jobBilling);
}
void QCupsJobWidget::setJobBilling(const QString &jobBilling)