+ fixes #0001928: The export CAD dialog in PartGui always adds an extension to the filename

This commit is contained in:
wmayer 2015-01-20 21:38:38 +01:00
parent c05f7762f8
commit 2c7d8a2358

View File

@ -78,7 +78,8 @@ void FileDialog::accept()
if (!files.isEmpty()) {
QString ext = this->defaultSuffix();
QString file = files.front();
if (!ext.isEmpty() && !file.endsWith(ext, Qt::CaseInsensitive)) {
QFileInfo fi(file);
if (!ext.isEmpty() && fi.suffix().isEmpty()) {
file = QString::fromLatin1("%1.%2").arg(file).arg(ext);
// That's the built-in line edit
QLineEdit* fileNameEdit = this->findChild<QLineEdit*>(QString::fromLatin1("fileNameEdit"));