diff options
author | culler <culler> | 2017-11-25 17:17:57 (GMT) |
---|---|---|
committer | culler <culler> | 2017-11-25 17:17:57 (GMT) |
commit | 945ce561d3f680c8fea5981211b8afd2a2dc255d (patch) | |
tree | 62bf7d27e4d5fbf30260fb520810f8a52b76dc37 | |
parent | f9c9a4fdced6feae7223d9187fddc4003338fd87 (diff) | |
download | tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.zip tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.gz tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.bz2 |
Pass nil for allowedFileTypes rather than an empty array to select all files.
-rw-r--r-- | macosx/tkMacOSXDialog.c | 22 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 3 |
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; |