macos: disable the file-type filter (no mac runner to verify the objc2 API)
The setAllowedFileTypes block is commented out until a macOS CI runner exists — an unverified objc2 API shape (NSMutableArray<NSString> / addObject / the deprecated selector) would break the pack; the open panel accepts any file and the caller validates the extension.
This commit is contained in:
@@ -13,8 +13,7 @@ use cocoa::{
|
||||
},
|
||||
base::{BOOL, NO, YES, id, nil, selector},
|
||||
foundation::{
|
||||
NSArray, NSAutoreleasePool, NSBundle, NSInteger, NSMutableArray, NSProcessInfo, NSString,
|
||||
NSUInteger, NSURL,
|
||||
NSArray, NSAutoreleasePool, NSBundle, NSInteger, NSProcessInfo, NSString, NSUInteger, NSURL,
|
||||
},
|
||||
};
|
||||
use core_foundation::{
|
||||
@@ -768,19 +767,14 @@ impl Platform for MacPlatform {
|
||||
let _: () = msg_send![panel, setPrompt: ns_string(&prompt)];
|
||||
}
|
||||
|
||||
// Extension filter (the host's allowed_extensions): the
|
||||
// open panel's allowedFileTypes. Empty = any.
|
||||
if !options.allowed_extensions.is_empty() {
|
||||
let ns_array = {
|
||||
let arr = NSMutableArray::<NSString>::new();
|
||||
for ext in &options.allowed_extensions {
|
||||
let s = ns_string(ext.as_str());
|
||||
arr.addObject(&*s);
|
||||
}
|
||||
arr
|
||||
};
|
||||
let _: () = msg_send![panel, setAllowedFileTypes: &*ns_array];
|
||||
}
|
||||
// TODO(macos): the extension filter (setAllowedFileTypes:
|
||||
// from options.allowed_extensions) is DISABLED — no macOS
|
||||
// CI runner to verify the objc2 API shape
|
||||
// (NSMutableArray<NSString> / addObject / the deprecated
|
||||
// selector), and an unverified compile would break the
|
||||
// pack. The open panel accepts any file until a mac
|
||||
// machine/runner exists; the incoming path is validated
|
||||
// by the caller (extension dispatch) either way.
|
||||
|
||||
let _: () = msg_send![panel, beginWithCompletionHandler: block];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user