macOS: Remove DontConfirmOverwrite workaround
Does not work any more on recent macOS versions. As a bonus, Qt now handles file names which contain “___qt_very_unlikely_prefix_” correctly. Task-number: QTBUG-39791 Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fded886ff4b9869c1a9e016e3fae05cc409c9ccd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
fe32ed6653
commit
8d51a7a39e
@ -331,14 +331,7 @@ static QString strippedText(QString s)
|
||||
- (NSString *)panel:(id)sender userEnteredFilename:(NSString *)filename confirmed:(BOOL)okFlag
|
||||
{
|
||||
Q_UNUSED(sender);
|
||||
if (!okFlag)
|
||||
return filename;
|
||||
if (!mOptions->testOption(QFileDialogOptions::DontConfirmOverwrite))
|
||||
return filename;
|
||||
|
||||
// User has clicked save, and no overwrite confirmation should occur.
|
||||
// To get the latter, we need to change the name we return (hence the prefix):
|
||||
return [@"___qt_very_unlikely_prefix_" stringByAppendingString:filename];
|
||||
return filename;
|
||||
}
|
||||
|
||||
- (void)setNameFilters:(const QStringList &)filters hideDetails:(BOOL)hideDetails
|
||||
@ -396,7 +389,7 @@ static QString strippedText(QString s)
|
||||
if (fileInfo.suffix().isEmpty() && !defaultSuffix.isEmpty()) {
|
||||
filename.append('.').append(defaultSuffix);
|
||||
}
|
||||
result << QUrl::fromLocalFile(filename.remove(QLatin1String("___qt_very_unlikely_prefix_")));
|
||||
result << QUrl::fromLocalFile(filename);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user