Unix printing: Fix suggested file name for printing to file.

Change-Id: Ieefe602dc8328a2e4188f7fa341016f8e330526e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Friedemann Kleint 2012-07-17 09:52:31 +02:00 committed by Qt by Nokia
parent 178f5e2ac3
commit dc4cd551c6

View File

@ -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