Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Fix native file dialog with empty filter list. #90783

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions platform/macos/godot_open_save_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ - (void)makeAccessoryView:(NSSavePanel *)p_panel filters:(const Vector<String> &
if ([new_allowed_types count] > 0) {
NSMutableArray *type_filters = [new_allowed_types objectAtIndex:0];
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
[p_panel setAllowedFileTypes:@[]];
[p_panel setAllowedFileTypes:nil];
[p_panel setAllowsOtherFileTypes:true];
} else {
[p_panel setAllowsOtherFileTypes:false];
[p_panel setAllowedFileTypes:type_filters];
}
} else {
[p_panel setAllowedFileTypes:@[]];
[p_panel setAllowedFileTypes:nil];
[p_panel setAllowsOtherFileTypes:true];
}
}
Expand Down Expand Up @@ -248,15 +248,15 @@ - (void)popupFileAction:(id)p_sender {
if (allowed_types && index < [allowed_types count]) {
NSMutableArray *type_filters = [allowed_types objectAtIndex:index];
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
[dialog setAllowedFileTypes:@[]];
[dialog setAllowedFileTypes:nil];
[dialog setAllowsOtherFileTypes:true];
} else {
[dialog setAllowsOtherFileTypes:false];
[dialog setAllowedFileTypes:type_filters];
}
cur_index = index;
} else {
[dialog setAllowedFileTypes:@[]];
[dialog setAllowedFileTypes:nil];
[dialog setAllowsOtherFileTypes:true];
cur_index = -1;
}
Expand Down
Loading