path: root/src/printsupport
diff options
authorRafael Roquetto <>2012-10-10 15:43:50 -0300
committerThe Qt Project <>2012-10-13 05:51:19 +0200
commiteda0e120e9e2e7b7be747f4ed035d686c9547769 (patch)
treefa1d1e43e0cceb0a5f5d2b3abe67e452a2d9dab4 /src/printsupport
parent491247acd4b12ce563ecaa67cd144ff073d84cc4 (diff)
Fix number of available printers in CUPS support.
If the number of available printers changes, we want to update the count. Additionally, if that number has gone to zero, we want to ensure that the number of available printers in the static object is reset to zero. This fixes a crash that occurs if: * You print * You kill cupsd (or it crashes because you're porting it and your port is unstable) * You try to print again before restarting it. Change-Id: I6c6069db9d800ce7426e75df760829fea278e56e Reviewed-by: Sean Harmer <> Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/printsupport')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index dd385526d7..ea18f1edf6 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -135,7 +135,7 @@ QCUPSSupport::QCUPSSupport()
if (!isAvailable())
- prnCount = _cupsGetDests(&printers);
+ qt_cups_num_printers = prnCount = _cupsGetDests(&printers);
for (int i = 0; i < prnCount; ++i) {
if (printers[i].is_default) {