forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
This commit is contained in:
@@ -702,14 +702,16 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa
|
||||
const int index = regExp.lastIndexIn(*selectedFilter);
|
||||
if (index != -1) {
|
||||
bool suffixOk = false;
|
||||
const QStringList &suffixes = regExp.cap(1).remove(QLatin1Char('*')).split(QLatin1Char(' '));
|
||||
foreach (const QString &suffix, suffixes)
|
||||
QString caption = regExp.cap(1);
|
||||
caption.remove(QLatin1Char('*'));
|
||||
const QVector<QStringRef> suffixes = caption.splitRef(QLatin1Char(' '));
|
||||
foreach (const QStringRef &suffix, suffixes)
|
||||
if (fileName.endsWith(suffix)) {
|
||||
suffixOk = true;
|
||||
break;
|
||||
}
|
||||
if (!suffixOk && !suffixes.isEmpty())
|
||||
fileName.append(suffixes.at(0));
|
||||
fileName.append(suffixes.at(0).toString());
|
||||
}
|
||||
}
|
||||
if (QFile::exists(fileName)) {
|
||||
|
Reference in New Issue
Block a user