In the File Manager, if the path is invalid, show the list of drives instead of an empty menu.

This commit is contained in:
Robbbert 2014-05-29 11:15:11 +00:00
parent 78696f9ca5
commit d17e376dc6

View File

@ -546,8 +546,6 @@ void ui_menu_file_selector::populate()
// open the directory
err = zippath_opendir(path, &directory);
if (err != FILERR_NONE)
goto done;
// clear out the menu entries
m_entrylist = NULL;
@ -580,6 +578,8 @@ void ui_menu_file_selector::populate()
}
// build the menu for each item
if (err == FILERR_NONE)
{
while((dirent = zippath_readdir(directory)) != NULL)
{
// append a dirent entry
@ -596,6 +596,7 @@ void ui_menu_file_selector::populate()
selected_entry = entry;
}
}
}
// append all of the menu entries
for (entry = m_entrylist; entry != NULL; entry = entry->next)
@ -608,7 +609,6 @@ void ui_menu_file_selector::populate()
// set up custom render proc
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
done:
if (directory != NULL)
zippath_closedir(directory);
}