cups: Clear cups options at the start of QPrintPropertiesDialog::setupPrinter
For some reason the cups options are kept globally instead of per printer at QCupsPrintEnginePrivate so when setting the printer options on accepting the print dialog, we first need to clear them and then call the other functions that set them, otherwise, we will "reuse" cups option set on the previous print. How to reproduce: * Open print dialog, set some advanced option to a non default value, easiest one is print in grayscale * Print * Check it prints in grayscale * Open print dialog, check the advanced options are all on default values * Print * Check it incorrectly prints in grayscale Change-Id: I59aacaf30db844ad40887d6b771f9354557852b6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
cb142954c5
commit
ae3a65122f
src/printsupport
@ -403,6 +403,10 @@ QPrintPropertiesDialog::~QPrintPropertiesDialog()
|
||||
|
||||
void QPrintPropertiesDialog::setupPrinter() const
|
||||
{
|
||||
#if QT_CONFIG(cups)
|
||||
QCUPSSupport::clearCupsOptions(m_printer);
|
||||
#endif
|
||||
|
||||
widget.pageSetup->setupPrinter();
|
||||
#if QT_CONFIG(cupsjobwidget)
|
||||
m_jobOptions->setupPrinter();
|
||||
|
@ -77,6 +77,11 @@ void QCUPSSupport::clearCupsOption(QPrinter *printer, const QString &option)
|
||||
}
|
||||
}
|
||||
|
||||
void QCUPSSupport::clearCupsOptions(QPrinter *printer)
|
||||
{
|
||||
setCupsOptions(printer, QStringList());
|
||||
}
|
||||
|
||||
static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, const QTime holdUntilTime)
|
||||
{
|
||||
switch (jobHold) {
|
||||
|
@ -132,6 +132,7 @@ public:
|
||||
|
||||
static void setCupsOption(QPrinter *printer, const QString &option, const QString &value);
|
||||
static void clearCupsOption(QPrinter *printer, const QString &option);
|
||||
static void clearCupsOptions(QPrinter *printer);
|
||||
|
||||
static void setJobHold(QPrinter *printer, const JobHoldUntil jobHold = NoHold, const QTime &holdUntilTime = QTime());
|
||||
static void setJobBilling(QPrinter *printer, const QString &jobBilling = QString());
|
||||
|
Loading…
Reference in New Issue
Block a user