Remove deprecated macOS file type handling from FileDialogWrapper for cleaner code and improved compatibility. This change simplifies the file dialog implementation by eliminating legacy checks for older macOS versions.
This commit is contained in:
@@ -75,18 +75,6 @@ std::string yaze::core::FileDialogWrapper::ShowOpenFileDialogBespoke() {
|
|||||||
[openPanel setCanChooseDirectories:NO];
|
[openPanel setCanChooseDirectories:NO];
|
||||||
[openPanel setAllowsMultipleSelection:NO];
|
[openPanel setAllowsMultipleSelection:NO];
|
||||||
|
|
||||||
// Use modern allowedContentTypes for macOS 12.0+ compatibility
|
|
||||||
if (@available(macOS 12.0, *)) {
|
|
||||||
[openPanel setAllowedContentTypes:@[
|
|
||||||
[UTType typeWithFilenameExtension:@"sfc"],
|
|
||||||
[UTType typeWithFilenameExtension:@"smc"],
|
|
||||||
[UTType typeWithFilenameExtension:@"yaze"]
|
|
||||||
]];
|
|
||||||
} else {
|
|
||||||
// Fallback for older macOS versions
|
|
||||||
[openPanel setAllowedFileTypes:@[ @"sfc", @"smc", @"yaze" ]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([openPanel runModal] == NSModalResponseOK) {
|
if ([openPanel runModal] == NSModalResponseOK) {
|
||||||
NSURL* url = [[openPanel URLs] objectAtIndex:0];
|
NSURL* url = [[openPanel URLs] objectAtIndex:0];
|
||||||
NSString* path = [url path];
|
NSString* path = [url path];
|
||||||
|
|||||||
Reference in New Issue
Block a user