SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 15588a065f80e6819d687ecca7aef8cfa3e1bac5 parent d52a50353dcb6376125146bc562db705c2d5a4ba Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 28 Jun 2025 15:04:14 +0300 Fixed a bug where ROMs were moved instead of copied and vice versa, fixes #701 Diffstat:
| M | iOS/GBROMManager.m | 10 | +++++++++- |
| M | iOS/GBViewController.m | 4 | ++-- |
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/iOS/GBROMManager.m b/iOS/GBROMManager.m @@ -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; } diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m @@ -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];
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.