mirror of https://github.com/LIJI32/SameBoy.git
Fixed a bug where ROMs were moved instead of copied and vice versa, fixes #701
This commit is contained in:
parent
d52a50353d
commit
15588a065f
|
@ -25,6 +25,12 @@
|
|||
if (!self) return nil;
|
||||
self.currentROM = [[NSUserDefaults standardUserDefaults] stringForKey:@"GBLastROM"];
|
||||
_doneInitializing = true;
|
||||
|
||||
// Pre 1.0.2 versions might have kept temp files in there incorrectly
|
||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"GBDeletedInbox"]) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:[self.localRoot stringByAppendingPathComponent:@"Inbox"] error:nil];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"GBDeletedInbox"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -195,9 +201,11 @@
|
|||
[[NSFileManager defaultManager] removeItemAtPath:romFolder error:nil];
|
||||
return nil;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Remove the Inbox directory if empty after import
|
||||
rmdir([self.localRoot stringByAppendingPathComponent:@"Inbox"].UTF8String);
|
||||
|
||||
return friendlyName;
|
||||
}
|
||||
|
||||
|
|
|
@ -1508,7 +1508,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|||
[url startAccessingSecurityScopedResource];
|
||||
[GBROMManager sharedManager].currentROM =
|
||||
[[GBROMManager sharedManager] importROM:url.path
|
||||
keepOriginal:![url.path hasPrefix:tempDir] && !inPlace];
|
||||
keepOriginal:![url.path hasPrefix:tempDir] && inPlace];
|
||||
[url stopAccessingSecurityScopedResource];
|
||||
}
|
||||
return true;
|
||||
|
@ -1521,7 +1521,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|||
}
|
||||
[url startAccessingSecurityScopedResource];
|
||||
[[GBROMManager sharedManager] importROM:url.path
|
||||
keepOriginal:![url.path hasPrefix:tempDir] && !inPlace];
|
||||
keepOriginal:![url.path hasPrefix:tempDir] && inPlace];
|
||||
[url stopAccessingSecurityScopedResource];
|
||||
}
|
||||
[self openLibrary];
|
||||
|
|
Loading…
Reference in New Issue