1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

MacPDF: Make "Open With" and dropping files on dock tile work

I would've expected that there's some way to have this work
automatically in an NSDocument-based application, but I haven't
found it yet. So manually implement the delegate for now.
This commit is contained in:
Nico Weber 2023-10-19 09:58:59 -04:00 committed by Tim Flynn
parent 708d5e2fe6
commit ff4b0e678b

View file

@ -35,4 +35,13 @@
return YES;
}
- (BOOL)application:(NSApplication*)sender openFile:(NSString*)filename
{
[[NSDocumentController sharedDocumentController]
openDocumentWithContentsOfURL:[NSURL fileURLWithPath:filename]
display:YES
completionHandler:^(NSDocument*, BOOL, NSError*) {}];
return YES;
}
@end