diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-07-17 09:52:31 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-17 15:56:15 +0200 |
commit | dc4cd551c66111a9d3876dc324f7e52fc3cca2a6 (patch) | |
tree | 636d8a0b51b06e74c54d4f22e01cbdade760876c /src/printsupport/dialogs | |
parent | 178f5e2ac37b77472543db541ed7321fe771c189 (diff) |
Unix printing: Fix suggested file name for printing to file.
Change-Id: Ieefe602dc8328a2e4188f7fa341016f8e330526e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/printsupport/dialogs')
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_unix.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 3b189e2cb5..fe352b00e9 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -912,18 +912,19 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties(QPrinter *p) cur += QLatin1Char('/'); if (cur.left(home.length()) != home) cur = home; -#ifdef Q_WS_X11 - if (p->docName().isEmpty()) { - cur += QLatin1String("print.pdf"); - } else { - QRegExp re(QString::fromLatin1("(.*)\\.\\S+")); - if (re.exactMatch(p->docName())) - cur += re.cap(1); - else - cur += p->docName(); - cur += QLatin1String(".pdf"); - } -#endif + if (QGuiApplication::platformName() == QLatin1String("xcb")) { + if (p->docName().isEmpty()) { + cur += QLatin1String("print.pdf"); + } else { + QRegExp re(QString::fromLatin1("(.*)\\.\\S+")); + if (re.exactMatch(p->docName())) + cur += re.cap(1); + else + cur += p->docName(); + cur += QLatin1String(".pdf"); + } + } // xcb + widget.filename->setText(cur); } else |