diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-26 01:18:49 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-26 01:18:49 +0000 |
| commit | a7f23657775ce54a5f2a92b4419c12b181d73b6d (patch) | |
| tree | 8dd9307a51dd9b63ac410a96f055220fb441073c | |
| parent | 21b5b2706fdd83fc225d340a0e347d7d0d0c000c (diff) | |
| download | pcsxr-a7f23657775ce54a5f2a92b4419c12b181d73b6d.tar.gz | |
Handle if we don't get sent a user dictionary or the memory card changed.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85560 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rwxr-xr-x | macosx/ConfigurationController.m | 2 | ||||
| -rwxr-xr-x | macosx/PcsxrMemCardController.m | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m index 8f6a296d..adadb92e 100755 --- a/macosx/ConfigurationController.m +++ b/macosx/ConfigurationController.m @@ -154,7 +154,7 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey"; - (void)memoryCardDidChangeNotification:(NSNotification *)aNote { NSNumber *aNumber = [[aNote userInfo] objectForKey:memCardChangeNumberKey]; - int iNum = [aNumber intValue]; + int iNum = aNumber ? [aNumber intValue] : 3; if (iNum & 1) { NSURL *path = [[NSUserDefaults standardUserDefaults] URLForKey:@"Mcd1"]; diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m index a79d2bf6..158c99ed 100755 --- a/macosx/PcsxrMemCardController.m +++ b/macosx/PcsxrMemCardController.m @@ -43,12 +43,12 @@ static inline void CopyMemcardData(char *from, char *to, int srci, int dsti, cha LoadMcd(theCards, theCards == 1 ? Config.Mcd1 : Config.Mcd2); } NSFileManager *fm = [NSFileManager defaultManager]; - + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *fullPath = nil; NSString *fileName = nil; if (theCards & 1) { - fullPath = [[[NSUserDefaults standardUserDefaults] URLForKey:@"Mcd1"] path]; + fullPath = [[def URLForKey:@"Mcd1"] path]; fileName = [fm displayNameAtPath:fullPath]; [memCard1Label setTitleWithMnemonic:fileName]; @@ -59,7 +59,7 @@ static inline void CopyMemcardData(char *from, char *to, int srci, int dsti, cha } if (theCards & 2) { - fullPath = [[[NSUserDefaults standardUserDefaults] URLForKey:@"Mcd2"] path]; + fullPath = [[def URLForKey:@"Mcd2"] path]; fileName = [fm displayNameAtPath:fullPath]; [memCard2Label setTitleWithMnemonic:fileName]; @@ -189,7 +189,7 @@ static inline void CopyMemcardData(char *from, char *to, int srci, int dsti, cha { NSDictionary *dict = [aNote userInfo]; NSNumber *theNum = [dict objectForKey:memCardChangeNumberKey]; - [self setupValues:[theNum intValue]]; + [self setupValues: theNum ? [theNum intValue] : 3]; } - (void)windowDidLoad |
