1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #98812 from bruvzg/macos_bundles_as_file

[macOS] Handle bundles as files in the embedded file dialogs.
This commit is contained in:
Thaddeus Crews
2024-12-03 14:41:07 -06:00
9 changed files with 213 additions and 47 deletions

View File

@@ -50,6 +50,8 @@ protected:
virtual bool is_hidden(const String &p_name) override;
virtual bool is_case_sensitive(const String &p_path) const override;
virtual bool is_bundle(const String &p_file) const override;
};
#endif // UNIX ENABLED

View File

@@ -96,4 +96,14 @@ bool DirAccessMacOS::is_case_sensitive(const String &p_path) const {
return [cs boolValue];
}
bool DirAccessMacOS::is_bundle(const String &p_file) const {
String f = p_file;
if (!f.is_absolute_path()) {
f = get_current_dir().path_join(f);
}
f = fix_path(f);
return [[NSWorkspace sharedWorkspace] isFilePackageAtPath:[NSString stringWithUTF8String:f.utf8().get_data()]];
}
#endif // UNIX_ENABLED