From a603862e8da2d061f728a373acb503fa374b8c6b Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 17 Dec 2011 20:41:31 +0000 Subject: Multiple plug-in directories support for Mac OS X. It could be better: currently it uses hierarchy with the built-in plug-in path at the bottom and the user plug-in path at the top. I should probably do it by plug-in version. PlayStation plug-in double-clicked on Mac OS X are now moved to the user directory instead of the App's built-in plug-in directory. the previous method could cause problems if write support wasn't set in PCSXR, such as if it was created from a different user. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@73439 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/PcsxrPluginHandler.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'macosx/PcsxrPluginHandler.m') diff --git a/macosx/PcsxrPluginHandler.m b/macosx/PcsxrPluginHandler.m index b2231577..8a978876 100644 --- a/macosx/PcsxrPluginHandler.m +++ b/macosx/PcsxrPluginHandler.m @@ -56,12 +56,15 @@ [pluginName setObjectValue:[[NSURL fileURLWithPath:theFile] lastPathComponent]]; [NSApp runModalForWindow:[self window]]; - + [[self window] orderOut:self]; if (moveOK == YES) { + NSURL *supportURL = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL]; + NSURL *url = [supportURL URLByAppendingPathComponent:@"Pcsxr/PlugIns"]; + NSFileWrapper *wrapper = [[NSFileWrapper alloc] initWithPath:theFile]; NSString *dst = [NSString stringWithFormat:@"%@/%@", - [[NSBundle mainBundle] builtInPlugInsPath], + [url path], [wrapper filename]]; if ([wrapper writeToFile:dst atomically:NO updateFilenames:NO]) { [[NSWorkspace sharedWorkspace] noteFileSystemChanged:[[NSBundle mainBundle] builtInPlugInsPath]]; -- cgit v1.2.3