Fix that it was not possible to save with arbitrary file extension

On Windows.

Task-number: QTCREATORBUG-15862
Change-Id: I5cc76662e4996bfa26eece09f2e30dc3ce873eb5
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2016-11-14 14:28:59 +01:00
parent 53d45de8a0
commit fc69e4ef54
4 changed files with 13 additions and 7 deletions

View File

@@ -696,8 +696,7 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa
// specified. Otherwise the suffix must be one available in the selected filter. If
// the name already ends with such suffix nothing needs to be done. But if not, the
// first one from the filter is appended.
if (selectedFilter && *selectedFilter != QCoreApplication::translate(
"Core", Constants::ALL_FILES_FILTER)) {
if (selectedFilter && *selectedFilter != MimeDatabase::allFilesFilterString()) {
// Mime database creates filter strings like this: Anything here (*.foo *.bar)
QRegExp regExp(QLatin1String(".*\\s+\\((.*)\\)$"));
const int index = regExp.lastIndexIn(*selectedFilter);