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:
parent
178f5e2ac3
commit
dc4cd551c6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user