diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-11-09 13:45:41 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-11-09 13:51:49 (GMT) |
commit | e441fa33a1068e198bf2c7bc54f54f1ff13410c9 (patch) | |
tree | bebe75151696e94d3f8e11e59975905b8c38c2c3 /src/gui/dialogs | |
parent | cbfef77bb7bd370f7373edb78c2646328461d259 (diff) | |
download | Qt-e441fa33a1068e198bf2c7bc54f54f1ff13410c9.zip Qt-e441fa33a1068e198bf2c7bc54f54f1ff13410c9.tar.gz Qt-e441fa33a1068e198bf2c7bc54f54f1ff13410c9.tar.bz2 |
Fixed handling of the "..." button in QPrintDialog for X11.
Task-number: QTBUG-5547
Reviewed-by: Kim
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r-- | src/gui/dialogs/qprintdialog_unix.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 6fc270d..9d6cd55 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -835,9 +835,6 @@ void QUnixPrintWidgetPrivate::setOptionsPane(QPrintDialogPrivate *pane) void QUnixPrintWidgetPrivate::_q_btnBrowseClicked() { - const int prevPrinter = widget.printers->currentIndex(); - widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one - QString filename = widget.filename->text(); #ifndef QT_NO_FILEDIALOG filename = QFileDialog::getSaveFileName(parent, QPrintDialog::tr("Print To File ..."), filename, @@ -849,9 +846,11 @@ void QUnixPrintWidgetPrivate::_q_btnBrowseClicked() widget.filename->setText(filename); if (filename.endsWith(QString::fromLatin1(".ps"), Qt::CaseInsensitive)) widget.printers->setCurrentIndex(widget.printers->count() - 1); // the postscript one + else if (filename.endsWith(QString::fromLatin1(".pdf"), Qt::CaseInsensitive)) + widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one + else if (widget.printers->currentIndex() != widget.printers->count() - 1) // if ps is not selected, pdf is default + widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one } - else - widget.printers->setCurrentIndex(prevPrinter); } void QUnixPrintWidgetPrivate::applyPrinterProperties(QPrinter *p) |