Check if Print Properties dialog was shown before accessing it
Prevents a crash in case the user did not open the properties dialog, in which case QUnixPrintWidgetPrivate::propertiesDialog is null. Change-Id: I43c8c6ab90053757835bbf41d6167204d42efcef Reviewed-by: John Layt <jlayt@kde.org>bb10
parent
00e50fb97c
commit
a6f7ba0f8b
|
|
@ -864,16 +864,18 @@ bool QUnixPrintWidgetPrivate::checkFields()
|
|||
}
|
||||
|
||||
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
|
||||
QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->widget.pagesPerSheetCombo->currentData().value<QCUPSSupport::PagesPerSheet>();
|
||||
if (propertiesDialogShown) {
|
||||
QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->widget.pagesPerSheetCombo->currentData().value<QCUPSSupport::PagesPerSheet>();
|
||||
|
||||
QCUPSSupport::PageSet pageSet = optionsPane->options.pageSetCombo->currentData().value<QCUPSSupport::PageSet>();
|
||||
QCUPSSupport::PageSet pageSet = optionsPane->options.pageSetCombo->currentData().value<QCUPSSupport::PageSet>();
|
||||
|
||||
if (propertiesDialogShown
|
||||
&& pagesPerSheet != QCUPSSupport::OnePagePerSheet
|
||||
&& pageSet != QCUPSSupport::AllPages) {
|
||||
QMessageBox::warning(q, q->windowTitle(),
|
||||
QPrintDialog::tr("Options 'Pages Per Sheet' and 'Page Set' cannot be used together.\nPlease turn one of those options off."));
|
||||
return false;
|
||||
|
||||
if (pagesPerSheet != QCUPSSupport::OnePagePerSheet
|
||||
&& pageSet != QCUPSSupport::AllPages) {
|
||||
QMessageBox::warning(q, q->windowTitle(),
|
||||
QPrintDialog::tr("Options 'Pages Per Sheet' and 'Page Set' cannot be used together.\nPlease turn one of those options off."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue