summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmacosx/PcsxrDiscHandler.h4
-rwxr-xr-xmacosx/PcsxrDiscHandler.m30
2 files changed, 16 insertions, 18 deletions
diff --git a/macosx/PcsxrDiscHandler.h b/macosx/PcsxrDiscHandler.h
index 150a580c..8ff673fb 100755
--- a/macosx/PcsxrDiscHandler.h
+++ b/macosx/PcsxrDiscHandler.h
@@ -8,10 +8,12 @@
#import <Foundation/Foundation.h>
#import "PcsxrFileHandle.h"
+#import "ARCBridge.h"
@interface PcsxrDiscHandler : NSObject <PcsxrFileHandle>
{
- NSURL *discURL;
+ NSURL *_discURL;
+ __arcweak NSString *discPath;
}
@end
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;
}