Stop using deprecated APIs on macOS in server launcher

(cherry picked from commit dcbd8197a4)
This commit is contained in:
heinrich5991 2017-11-17 14:57:42 +01:00
parent 94bbe2bc09
commit dae85e244c

View file

@ -9,7 +9,7 @@
@end @end
@implementation ServerView @implementation ServerView
- (void)listenTo: (NSTask*)t; - (void)listenTo: (NSTask *)t
{ {
NSPipe *pipe; NSPipe *pipe;
task = t; task = t;
@ -58,14 +58,10 @@ void runServer()
NSOpenPanel *openDlg = [NSOpenPanel openPanel]; NSOpenPanel *openDlg = [NSOpenPanel openPanel];
[openDlg setCanChooseFiles:YES]; [openDlg setCanChooseFiles:YES];
if([openDlg runModalForDirectory:nil file:nil] != NSOKButton) if([openDlg runModal] != NSOKButton)
return; return;
NSArray* filenames = [openDlg filenames]; NSString *filename = [[openDlg URL] path];
if([filenames count] != 1)
return;
NSString* filename = [filenames objectAtIndex: 0];
NSArray *arguments = [NSArray arrayWithObjects: @"-f", filename, nil]; NSArray *arguments = [NSArray arrayWithObjects: @"-f", filename, nil];
// run server // run server