From fded886ff4b9869c1a9e016e3fae05cc409c9ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 10 Dec 2020 15:27:32 +0100 Subject: macOS: Remove DontConfirmOverwrite workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3