From dc4cd551c66111a9d3876dc324f7e52fc3cca2a6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 17 Jul 2012 09:52:31 +0200 Subject: Unix printing: Fix suggested file name for printing to file. Change-Id: Ieefe602dc8328a2e4188f7fa341016f8e330526e Reviewed-by: Joerg Bornemann --- src/printsupport/dialogs/qprintdialog_unix.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/printsupport/dialogs') 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 -- cgit v1.2.3