summaryrefslogtreecommitdiff
path: root/macosx/PcsxrDiscHandler.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-08 23:35:59 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-08 23:35:59 +0000
commit2b8ba2c882c831e71956dcaef175cde2670ee6b5 (patch)
tree1abdf17a421465484e9556d185f3f09b35bbc5c7 /macosx/PcsxrDiscHandler.m
parent3a71f744bd13017cd74414481f78c5d10142cbde (diff)
downloadpcsxr-2b8ba2c882c831e71956dcaef175cde2670ee6b5.tar.gz
Rework the disc handler on OS X a bit.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85917 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrDiscHandler.m')
-rwxr-xr-xmacosx/PcsxrDiscHandler.m30
1 files changed, 13 insertions, 17 deletions
diff --git a/macosx/PcsxrDiscHandler.m b/macosx/PcsxrDiscHandler.m
index 6a424ef3..77a35569 100755
--- a/macosx/PcsxrDiscHandler.m
+++ b/macosx/PcsxrDiscHandler.m
@@ -16,19 +16,21 @@
#import "ARCBridge.h"
@interface PcsxrDiscHandler ()
-@property (arcstrong) NSURL *discURL;
+@property (nonatomic, arcstrong) NSURL *discURL;
+@property (arcweak) NSString *discPath;
@end
@implementation PcsxrDiscHandler
-@synthesize discURL;
+@synthesize discURL = _discURL;
+@synthesize discPath;
-- (NSURL*)discURLFromFilePath:(NSString *)filePath
+- (NSURL*)discURL
{
- if (!discURL) {
- self.discURL = [NSURL fileURLWithPath:filePath isDirectory:NO];
+ if (!_discURL) {
+ self.discURL = [NSURL fileURLWithPath:discPath isDirectory:NO];
}
- return self.discURL;
+ return _discURL;
}
+ (NSArray *)supportedUTIs
@@ -42,19 +44,13 @@
- (BOOL)handleFile:(NSString *)theFile
{
+ self.discPath = theFile;
PcsxrController *appDelegate = [NSApp delegate];
- if ([EmuThread active] == YES) {
- if (UsingIso()) {
- SetIsoFile([theFile fileSystemRepresentation]);
- SetCdOpenCaseTime(time(NULL) + 2);
- LidInterrupt();
- } else {
- return NO;
- }
- } else {
- [appDelegate runURL:[self discURLFromFilePath:theFile]];
+ if ([EmuThread active] == YES && !UsingIso()) {
+ return NO;
}
- [[appDelegate recentItems] addRecentItem:[self discURLFromFilePath:theFile]];
+ [appDelegate runURL:[self discURL]];
+ [[appDelegate recentItems] addRecentItem:[self discURL]];
return YES;
}