mirror of https://github.com/mpv-player/mpv
osx: fix macOS 10.13 deprecation warning
NSFileHandlingPanelOKButton is deprecated with macOS 10.13, but the replacement NSModalResponseOK is not available on 10.8 and earlier. added a declaration for 10.8 and earlier since i only officially dropped support for 10.7 and earlier. this is untested.
This commit is contained in:
parent
dba143de4d
commit
45ce4ba877
|
@ -52,6 +52,12 @@ static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask;
|
|||
static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask;
|
||||
static const NSEventModifierFlags NSEventModifierFlagCommand = NSCommandKeyMask;
|
||||
static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9)
|
||||
typedef NSUInteger NSModalResponse;
|
||||
static const NSModalResponse NSModalResponseOK = NSFileHandlingPanelOKButton
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* MPV_MACOSX_COMPAT */
|
||||
|
|
|
@ -660,7 +660,7 @@
|
|||
[panel setCanChooseDirectories:YES];
|
||||
[panel setAllowsMultipleSelection:YES];
|
||||
|
||||
if ([panel runModal] == NSFileHandlingPanelOKButton){
|
||||
if ([panel runModal] == NSModalResponseOK){
|
||||
NSMutableArray *fileArray = [[NSMutableArray alloc] init];
|
||||
for (id url in [panel URLs])
|
||||
[fileArray addObject:[url path]];
|
||||
|
|
Loading…
Reference in New Issue