diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-11-19 08:58:03 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-11-19 08:58:03 (GMT) |
commit | 879e2ea7d15510ec5f94d6d7a005b157b115f69f (patch) | |
tree | 73aedd0bffe7ab39387229a9417aa50cecbbf0aa /src/gui/dialogs/qprintdialog_unix.cpp | |
parent | 8fc2eec5b3282665f76f1e0313a03608bf4e7bc1 (diff) | |
parent | 80cd617b05ad3e647c87dc063d40cde0617344ca (diff) | |
download | Qt-879e2ea7d15510ec5f94d6d7a005b157b115f69f.zip Qt-879e2ea7d15510ec5f94d6d7a005b157b115f69f.tar.gz Qt-879e2ea7d15510ec5f94d6d7a005b157b115f69f.tar.bz2 |
Merge remote branch 'origin/4.6' into lighthouse
Conflicts:
configure
src/plugins/graphicssystems/graphicssystems.pro
Diffstat (limited to 'src/gui/dialogs/qprintdialog_unix.cpp')
-rw-r--r-- | src/gui/dialogs/qprintdialog_unix.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 7daa273..9d6cd55 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -696,7 +696,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p) #ifndef QT_NO_FILESYSTEMMODEL QFileSystemModel *fsm = new QFileSystemModel(widget.filename); fsm->setRootPath(QDir::homePath()); -#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) +#if !defined(QT_NO_FSCOMPLETER) && !defined(QT_NO_FILEDIALOG) widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename)); #endif #endif @@ -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) |