summaryrefslogtreecommitdiff
path: root/macosx/PcsxrDiscHandler.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-06-26 04:45:19 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-06-26 04:45:19 +0000
commite80786f8fa5438eb331c9da542064cf876a956aa (patch)
tree195bf24dd04eb1827c80b51b3bdfa903445ddca2 /macosx/PcsxrDiscHandler.m
parentcedd6e77340d6693630ff9d06b0a64d9be675de3 (diff)
downloadpcsxr-e80786f8fa5438eb331c9da542064cf876a956aa.tar.gz
Disable the net plug-in in the freeze state handler on demand.
Run the disc image from the handler through PcsxrController so that it can disable the net plug-in as needed. Cache the NSURL value in the Disc handler. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85563 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrDiscHandler.m')
-rwxr-xr-xmacosx/PcsxrDiscHandler.m28
1 files changed, 25 insertions, 3 deletions
diff --git a/macosx/PcsxrDiscHandler.m b/macosx/PcsxrDiscHandler.m
index 1aea4e3e..1bf2bfe5 100755
--- a/macosx/PcsxrDiscHandler.m
+++ b/macosx/PcsxrDiscHandler.m
@@ -14,8 +14,22 @@
#import "RecentItemsMenu.h"
#import "PcsxrController.h"
+@interface PcsxrDiscHandler ()
+@property (retain) NSURL *discURL;
+@end
+
@implementation PcsxrDiscHandler
+@synthesize discURL;
+
+- (NSURL*)discURLFromFilePath:(NSString *)filePath
+{
+ if (!discURL) {
+ self.discURL = [NSURL fileURLWithPath:filePath isDirectory:NO];
+ }
+ return self.discURL;
+}
+
+ (NSArray *)supportedUTIs
{
static NSArray *utisupport = nil;
@@ -38,11 +52,19 @@
return NO;
}
} else {
- SetIsoFile([theFile fileSystemRepresentation]);
- [EmuThread run];
+ [appDelegate runURL:[self discURLFromFilePath:theFile]];
}
- [[appDelegate recentItems] addRecentItem:[NSURL fileURLWithPath:theFile]];
+ [[appDelegate recentItems] addRecentItem:[self discURLFromFilePath:theFile]];
return YES;
}
+#if !__has_feature(objc_arc)
+- (void)dealloc
+{
+ self.discURL = nil;
+
+ [super dealloc];
+}
+#endif
+
@end