- NSMutableArray* extensions = [NSMutableArray arrayWithCapacity:0];
- BOOST_FOREACH(std::string ext, _filterPatterns) {
- if (!simgear::strutils::starts_with(ext, "*.")) {
- SG_LOG(SG_GENERAL, SG_INFO, "can't use pattern on Cococa:" << ext);
- continue;
+ if (_filterPatterns.empty()) {
+ [d->panel setAllowedFileTypes:nil];
+ } else {
+ NSMutableArray* extensions = [NSMutableArray arrayWithCapacity:0];
+ BOOST_FOREACH(std::string ext, _filterPatterns) {
+ if (!simgear::strutils::starts_with(ext, "*.")) {
+ SG_LOG(SG_GENERAL, SG_INFO, "can't use pattern on Cococa:" << ext);
+ continue;
+ }
+ [extensions addObject:stdStringToCocoa(ext.substr(2))];