diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-12-10 15:27:32 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-01-19 23:41:42 +0000 |
commit | fded886ff4b9869c1a9e016e3fae05cc409c9ccd (patch) | |
tree | 7d1a0fa3a8634648dd2e327df1c689cc4ded33c8 /src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | |
parent | 9c56d4da2ff631a8c1c30475bd792f6c86bda53c (diff) |
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.
Pick-to: 5.15 6.0
Task-number: QTBUG-39791
Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 1344ed75d9..0909b5e21a 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -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; } } |