(iOS) Get rid of systemDirectory

This commit is contained in:
Twinaphex 2014-07-20 00:25:43 +02:00
parent 7580058c22
commit 9b8d5b95a5
3 changed files with 8 additions and 9 deletions

View File

@ -614,7 +614,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)loadHistory
{
NSString* history_path = [NSString stringWithFormat:BOXSTRING("%@/%s"), [RetroArch_iOS get].systemDirectory, ".retroarch-game-history.txt"];
NSString* history_path = [NSString stringWithFormat:BOXSTRING("%s/%s"), g_defaults.system_dir, ".retroarch-game-history.txt"];
[self.navigationController pushViewController:[[RAHistoryMenu alloc] initWithHistoryPath:history_path] animated:YES];
}
@ -803,9 +803,9 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
setting_data_save_config(setting_data_get_list(), config);
config_set_string(config, "system_directory", [[RetroArch_iOS get].systemDirectory UTF8String]);
config_set_string(config, "savefile_directory", [[RetroArch_iOS get].systemDirectory UTF8String]);
config_set_string(config, "savestate_directory", [[RetroArch_iOS get].systemDirectory UTF8String]);
config_set_string(config, "system_directory", g_defaults.system_dir);
config_set_string(config, "savefile_directory", g_defaults.system_dir);
config_set_string(config, "savestate_directory", g_defaults.system_dir);
config_file_write(config, self.pathToSave.UTF8String);
config_file_free(config);
}

View File

@ -49,7 +49,6 @@ const void* apple_get_frontend_settings(void);
@property (nonatomic) NSString* configDirectory; // e.g. /var/mobile/Documents/.RetroArch
@property (nonatomic) NSString* documentsDirectory; // e.g. /var/mobile/Documents
@property (nonatomic) NSString* systemDirectory; // e.g. /var/mobile/Documents/.RetroArch
@end

View File

@ -198,9 +198,9 @@ static void handle_touch_event(NSArray* touches)
// Build system paths and test permissions
self.documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
self.systemDirectory = [self.documentsDirectory stringByAppendingPathComponent:@".RetroArch"];
snprintf(g_defaults.system_dir, sizeof(g_defaults.system_dir), "%s/%s", self.documentsDirectory.UTF8String, ".RetroArch");
self.configDirectory = self.systemDirectory;
self.configDirectory = BOXSTRING(g_defaults.system_dir);
snprintf(g_defaults.config_path, sizeof(g_defaults.config_path), "%s/retroarch.cfg", self.configDirectory.UTF8String);
snprintf(g_defaults.core_dir, sizeof(g_defaults.core_dir), "%s/%s", NSBundle.mainBundle.bundlePath.UTF8String, "modules");
@ -215,13 +215,13 @@ static void handle_touch_event(NSArray* touches)
}
else
{
path = self.systemDirectory.UTF8String;
path = g_defaults.system_dir;
path_mkdir(path);
if (access(path, 0755) != 0)
{
char msg[256];
snprintf(msg, sizeof(msg), "Failed to create or access system directory: %s", self.systemDirectory.UTF8String);
snprintf(msg, sizeof(msg), "Failed to create or access system directory: %s", g_defaults.system_dir);
apple_display_alert(msg, "Error");
}
else