[macOS] Fix native file dialog with empty filter list.
This commit is contained in:
parent
658e97c93a
commit
e667dc2d59
|
@ -177,14 +177,14 @@
|
||||||
if ([new_allowed_types count] > 0) {
|
if ([new_allowed_types count] > 0) {
|
||||||
NSMutableArray *type_filters = [new_allowed_types objectAtIndex:0];
|
NSMutableArray *type_filters = [new_allowed_types objectAtIndex:0];
|
||||||
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
|
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
|
||||||
[p_panel setAllowedFileTypes:@[]];
|
[p_panel setAllowedFileTypes:nil];
|
||||||
[p_panel setAllowsOtherFileTypes:true];
|
[p_panel setAllowsOtherFileTypes:true];
|
||||||
} else {
|
} else {
|
||||||
[p_panel setAllowsOtherFileTypes:false];
|
[p_panel setAllowsOtherFileTypes:false];
|
||||||
[p_panel setAllowedFileTypes:type_filters];
|
[p_panel setAllowedFileTypes:type_filters];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
[p_panel setAllowedFileTypes:@[]];
|
[p_panel setAllowedFileTypes:nil];
|
||||||
[p_panel setAllowsOtherFileTypes:true];
|
[p_panel setAllowsOtherFileTypes:true];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@
|
||||||
if (allowed_types && index < [allowed_types count]) {
|
if (allowed_types && index < [allowed_types count]) {
|
||||||
NSMutableArray *type_filters = [allowed_types objectAtIndex:index];
|
NSMutableArray *type_filters = [allowed_types objectAtIndex:index];
|
||||||
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
|
if (type_filters && [type_filters count] == 1 && [[type_filters objectAtIndex:0] isEqualToString:@"*"]) {
|
||||||
[dialog setAllowedFileTypes:@[]];
|
[dialog setAllowedFileTypes:nil];
|
||||||
[dialog setAllowsOtherFileTypes:true];
|
[dialog setAllowsOtherFileTypes:true];
|
||||||
} else {
|
} else {
|
||||||
[dialog setAllowsOtherFileTypes:false];
|
[dialog setAllowsOtherFileTypes:false];
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
}
|
}
|
||||||
cur_index = index;
|
cur_index = index;
|
||||||
} else {
|
} else {
|
||||||
[dialog setAllowedFileTypes:@[]];
|
[dialog setAllowedFileTypes:nil];
|
||||||
[dialog setAllowsOtherFileTypes:true];
|
[dialog setAllowsOtherFileTypes:true];
|
||||||
cur_index = -1;
|
cur_index = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue