ios: File browser now tries to root itself at '/var/mobile/RetroArchGames' and '/var/mobile' before settling on '/'.

This commit is contained in:
meancoot 2013-02-10 07:22:03 -05:00
parent 4a8831cbdd
commit 64673845dd
2 changed files with 8 additions and 1 deletions

View File

@ -23,6 +23,13 @@ static BOOL is_directory(NSString* path)
{ {
self = [super initWithStyle:UITableViewStylePlain]; 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; directory = path;
list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directory error:nil]; list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directory error:nil];

View File

@ -33,7 +33,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
[RetroArch_iOS get].module_path = [modules objectAtIndex:indexPath.row]; [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 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section