diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-08-19 21:24:06 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-08-19 21:24:06 +0000 |
| commit | d37764cdea753d0d1fac4eb8f52338ffdd94889c (patch) | |
| tree | 6ad357a46bb4cd0cf192816532ba5ae68136bece | |
| parent | 9d66a1ec68ac6ddfd5b455ae505ae7ea7f939aa5 (diff) | |
| download | pcsxr-d37764cdea753d0d1fac4eb8f52338ffdd94889c.tar.gz | |
OS X: make the memory code movement code work.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91263 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | macosx/Source/PcsxrController.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/macosx/Source/PcsxrController.m b/macosx/Source/PcsxrController.m index ba2cb774..37b49179 100644 --- a/macosx/Source/PcsxrController.m +++ b/macosx/Source/PcsxrController.m @@ -674,7 +674,7 @@ otherblock();\ NSURL *oldMemoryURL = [[[manager URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL] URLByAppendingPathComponent:@"Pcsxr"] URLByAppendingPathComponent:@"Memory Cards"]; NSURL *memoryURL = [[[manager URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL] URLByAppendingPathComponent:@"Pcsxr"] URLByAppendingPathComponent:@"Memory Cards"]; - if (([[[NSProcessInfo processInfo] arguments] count] > 1 && !wasFinderLaunch) && [oldMemoryURL checkResourceIsReachableAndReturnError:NULL]) { + if (!wasFinderLaunch && [oldMemoryURL checkResourceIsReachableAndReturnError:NULL]) { NSDictionary *mcds = @{@"Mcd1": [defaults URLForKey:@"Mcd1"], @"Mcd2": [defaults URLForKey:@"Mcd2"]}; for (NSString *key in mcds) { @@ -686,12 +686,16 @@ otherblock();\ NSMutableArray *newPath = [[memoryURL pathComponents] mutableCopy]; [newPath addObjectsFromArray:barePath]; NSURL *replacementPath = [NSURL fileURLWithPathComponents:newPath]; - //if ([manager moveItemAtURL:obj toURL:replacementPath error:NULL]) { + if ([manager moveItemAtURL:obj toURL:replacementPath error:NULL]) { [defaults setURL:replacementPath forKey:key]; - //} + } } } - [manager moveItemAtURL:oldMemoryURL toURL:memoryURL error:NULL]; + NSArray *memoryFiles = [manager contentsOfDirectoryAtURL:oldMemoryURL includingPropertiesForKeys:@[] options:0 error:NULL]; + for (NSURL *memLoc in memoryFiles) { + [manager moveItemAtURL:memLoc toURL:[memoryURL URLByAppendingPathComponent:[memLoc lastPathComponent]] error:NULL]; + } + [manager removeItemAtURL:oldMemoryURL error:NULL]; [defaults setBool:YES forKey:@"DidMoveMemoryObjects"]; } |
