(menu_common_backend.c) Refactor some code

This commit is contained in:
twinaphex 2014-10-16 06:52:25 +02:00
parent 58b3540ef0
commit 5ae79ef71d

View File

@ -479,8 +479,10 @@ static int menu_load_or_open_zip_iterate(unsigned action)
driver.menu_ctx->render_messagebox(msg);
}
if (action == MENU_ACTION_OK || action == MENU_ACTION_CANCEL)
switch (action)
{
case MENU_ACTION_OK:
case MENU_ACTION_CANCEL:
menu_entries_pop_list(driver.menu->menu_stack);
file_list_get_last(driver.menu->menu_stack, &menu_path, &menu_label,
@ -491,9 +493,12 @@ static int menu_load_or_open_zip_iterate(unsigned action)
file_list_get_at_offset(driver.menu->selection_buf,
driver.menu->selection_ptr, &path, NULL, &type);
break;
}
if (action == MENU_ACTION_OK)
switch (action)
{
case MENU_ACTION_OK:
{
char cat_path[PATH_MAX];
@ -501,7 +506,8 @@ static int menu_load_or_open_zip_iterate(unsigned action)
menu_entries_push(driver.menu->menu_stack, cat_path, menu_label, type,
driver.menu->selection_ptr);
}
else if (action == MENU_ACTION_CANCEL)
break;
case MENU_ACTION_CANCEL:
{
int ret = rarch_defer_core(g_extern.core_info, menu_path, path,
driver.menu->deferred_path, sizeof(driver.menu->deferred_path));
@ -516,8 +522,10 @@ static int menu_load_or_open_zip_iterate(unsigned action)
menu_entries_push(driver.menu->menu_stack,
g_settings.libretro_directory, "deferred_core_list", 0,
driver.menu->selection_ptr);
}
break;
}
return 0;
}