From 64673845ddfec7a8cf55a11afc76e0ab5d88ba23 Mon Sep 17 00:00:00 2001 From: meancoot Date: Sun, 10 Feb 2013 07:22:03 -0500 Subject: [PATCH] ios: File browser now tries to root itself at '/var/mobile/RetroArchGames' and '/var/mobile' before settling on '/'. --- ios/RetroArch/directory_list.m | 7 +++++++ ios/RetroArch/module_list.m | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/RetroArch/directory_list.m b/ios/RetroArch/directory_list.m index c8b74543ea..de985884a9 100644 --- a/ios/RetroArch/directory_list.m +++ b/ios/RetroArch/directory_list.m @@ -23,6 +23,13 @@ static BOOL is_directory(NSString* path) { self = [super initWithStyle:UITableViewStylePlain]; + if (path == nil) + { + if (is_directory(@"/var/mobile/RetroArchGames")) path = @"/var/mobile/RetroArchGames"; + else if (is_directory(@"/var/mobile")) path = @"/var/mobile"; + else path = @"/"; + } + directory = path; list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directory error:nil]; diff --git a/ios/RetroArch/module_list.m b/ios/RetroArch/module_list.m index 151efdc6f5..f898c1b12a 100644 --- a/ios/RetroArch/module_list.m +++ b/ios/RetroArch/module_list.m @@ -33,7 +33,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [RetroArch_iOS get].module_path = [modules objectAtIndex:indexPath.row]; - [[RetroArch_iOS get].navigator pushViewController:[[directory_list alloc] initWithPath:@"/"] animated:YES]; + [[RetroArch_iOS get].navigator pushViewController:[[directory_list alloc] initWithPath:nil] animated:YES]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section