mirror of
https://github.com/holub/mame
synced 2025-04-29 11:30:28 +03:00
In the File Manager, if the path is invalid, show the list of drives instead of an empty menu.
This commit is contained in:
parent
78696f9ca5
commit
d17e376dc6
@ -546,8 +546,6 @@ void ui_menu_file_selector::populate()
|
|||||||
|
|
||||||
// open the directory
|
// open the directory
|
||||||
err = zippath_opendir(path, &directory);
|
err = zippath_opendir(path, &directory);
|
||||||
if (err != FILERR_NONE)
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
// clear out the menu entries
|
// clear out the menu entries
|
||||||
m_entrylist = NULL;
|
m_entrylist = NULL;
|
||||||
@ -580,6 +578,8 @@ void ui_menu_file_selector::populate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// build the menu for each item
|
// build the menu for each item
|
||||||
|
if (err == FILERR_NONE)
|
||||||
|
{
|
||||||
while((dirent = zippath_readdir(directory)) != NULL)
|
while((dirent = zippath_readdir(directory)) != NULL)
|
||||||
{
|
{
|
||||||
// append a dirent entry
|
// append a dirent entry
|
||||||
@ -596,6 +596,7 @@ void ui_menu_file_selector::populate()
|
|||||||
selected_entry = entry;
|
selected_entry = entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// append all of the menu entries
|
// append all of the menu entries
|
||||||
for (entry = m_entrylist; entry != NULL; entry = entry->next)
|
for (entry = m_entrylist; entry != NULL; entry = entry->next)
|
||||||
@ -608,7 +609,6 @@ void ui_menu_file_selector::populate()
|
|||||||
// set up custom render proc
|
// set up custom render proc
|
||||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||||
|
|
||||||
done:
|
|
||||||
if (directory != NULL)
|
if (directory != NULL)
|
||||||
zippath_closedir(directory);
|
zippath_closedir(directory);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user