Skip to content

Commit

Permalink
Allow '*.ext' for allowed file types on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
camila314 committed Jan 12, 2025
1 parent 05d6ee2 commit b8cff6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion loader/src/platform/mac/util.mm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ @implementation FileDialog
NSMutableArray* allowedFileTypes = [NSMutableArray new];
for (auto& filter : options.filters) {
for (auto& ext : filter.files) {
[allowedFileTypes addObject: intoNS(ext)];
if (ext.size() > 2 && strncmp(ext.c_str(), "*.", 2) == 0)
[allowedFileTypes addObject: intoNS(ext.substr(2))];
else
[allowedFileTypes addObject: intoNS(ext)];
}
}
[openPanel setAllowedFileTypes: allowedFileTypes];
Expand Down

0 comments on commit b8cff6d

Please sign in to comment.