If CUPS has no default printer, set up the first one in list
Otherwise QCUPSSupport is instantiated without any printer being set up, which leads to bugs and/or crashes in other parts using QCUPSSupport. Change-Id: I1f4ddde5a28d6448d78aed856104ce8448e213c7 Reviewed-by: John Layt <jlayt@kde.org>
This commit is contained in:
parent
befe02aa6e
commit
229d92dc1e
@ -144,11 +144,13 @@ QCUPSSupport::QCUPSSupport()
|
||||
for (int i = 0; i < prnCount; ++i) {
|
||||
if (printers[i].is_default) {
|
||||
currPrinterIndex = i;
|
||||
setCurrentPrinter(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (prnCount > 0)
|
||||
setCurrentPrinter(currPrinterIndex);
|
||||
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
cups_lang_t *cupsLang = _cupsLangGet(0);
|
||||
codec = QTextCodec::codecForName(_cupsLangEncoding(cupsLang));
|
||||
|
Loading…
Reference in New Issue
Block a user