From 353c7a71dc9a9b5a08595a3cc312447c5c8d84be Mon Sep 17 00:00:00 2001 From: Chris Hocking Date: Fri, 29 Dec 2023 10:50:26 +1100 Subject: [PATCH] Fix warnings in hs.dialog - Replaced `setAllowedFileTypes` with `setAllowedContentTypes`. --- extensions/dialog/libdialog.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/dialog/libdialog.m b/extensions/dialog/libdialog.m index c0c17cab3..d6f47f211 100755 --- a/extensions/dialog/libdialog.m +++ b/extensions/dialog/libdialog.m @@ -1,6 +1,8 @@ @import Cocoa ; @import LuaSkin ; +#import + #define NO_INTENTS #import "MJAppDelegate.h" #undef NO_INTENTS @@ -355,16 +357,17 @@ static int chooseFileOrFolder(lua_State *L) { NSOpenPanel *panel = [NSOpenPanel openPanel]; // Allowed File Types: - NSMutableArray *allowedFileTypes; + NSMutableArray *allowedContentTypes; if (lua_istable(L, 6)) { - allowedFileTypes = [[NSMutableArray alloc] init]; + allowedContentTypes = [[NSMutableArray alloc] init]; lua_pushnil(L); while (lua_next(L, 6) != 0) { NSString *item = [NSString stringWithUTF8String:luaL_checkstring(L, -1)]; - [allowedFileTypes addObject:item]; + UTType *contentType = [UTType typeWithIdentifier:item]; + [allowedContentTypes addObject:contentType]; lua_pop(L, 1); } - [panel setAllowedFileTypes:allowedFileTypes]; + [panel setAllowedContentTypes:allowedContentTypes]; } // Message: