summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2017-11-25 17:17:57 (GMT)
committerculler <culler>2017-11-25 17:17:57 (GMT)
commit945ce561d3f680c8fea5981211b8afd2a2dc255d (patch)
tree62bf7d27e4d5fbf30260fb520810f8a52b76dc37 /macosx
parentf9c9a4fdced6feae7223d9187fddc4003338fd87 (diff)
downloadtk-945ce561d3f680c8fea5981211b8afd2a2dc255d.zip
tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.gz
tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.bz2
Pass nil for allowedFileTypes rather than an empty array to select all files.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c22
-rw-r--r--macosx/tkMacOSXInit.c3
2 files changed, 15 insertions, 10 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index b728393..97a282d 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -268,27 +268,35 @@ static NSURL *getFileURL(NSString *directory, NSString *filename) {
}
- (void)selectFormat:(id)sender {
- NSPopUpButton *button = (NSPopUpButton *)sender;
- filterInfo.fileTypeIndex = [button indexOfSelectedItem];
+ NSPopUpButton *button = (NSPopUpButton *)sender;
+ filterInfo.fileTypeIndex = [button indexOfSelectedItem];
#ifdef __clang__
NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex];
#else
NSMutableArray *allowedtypes = nil;
#endif
- [openpanel setAllowedFileTypes:allowedtypes];
+ if (allowedtypes && [allowedtypes count] > 0) {
+ [openpanel setAllowedFileTypes:allowedtypes];
+ } else {
+ [openpanel setAllowedFileTypes:nil];
+ }
filterInfo.userHasSelectedFilter = true;
-
}
- (void)saveFormat:(id)sender {
- NSPopUpButton *button = (NSPopUpButton *)sender;
- filterInfo.fileTypeIndex = [button indexOfSelectedItem];
+ NSPopUpButton *button = (NSPopUpButton *)sender;
+ filterInfo.fileTypeIndex = [button indexOfSelectedItem];
#ifdef __clang__
NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex];
#else
NSMutableArray *allowedtypes = nil;
#endif
- [savepanel setAllowedFileTypes:allowedtypes];
+ if (allowedtypes && [allowedtypes count] > 0) {
+ [savepanel setAllowedFileTypes:allowedtypes];
+ } else {
+ [savepanel setAllowedFileTypes:nil];
+ }
+ filterInfo.userHasSelectedFilter = true;
}
@end
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 5c8c0b7..6eba796 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -264,9 +264,6 @@ TkpInit(
*/
if (!initialized) {
- int bundledExecutable = 0;
- CFBundleRef bundleRef;
- CFURLRef bundleUrl = NULL;
struct utsname name;
struct stat st;