From 2c7d8a2358ce68ed46cd2cf9141006eb7d78befa Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 20 Jan 2015 21:38:38 +0100 Subject: [PATCH] + fixes #0001928: The export CAD dialog in PartGui always adds an extension to the filename --- src/Gui/FileDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index 5aa1846e1..2372dad2e 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -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(QString::fromLatin1("fileNameEdit"));