diff options
-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; |