Get rid of menu_entry_go_back

This commit is contained in:
twinaphex 2016-06-22 06:55:11 +02:00
parent ee9cb593c5
commit 02ad99048d
5 changed files with 15 additions and 17 deletions

View File

@ -17,6 +17,7 @@
#include <string/stdstring.h> #include <string/stdstring.h>
#include "../menu_driver.h" #include "../menu_driver.h"
#include "../menu_navigation.h"
#include "../menu_cbs.h" #include "../menu_cbs.h"
#include "../../msg_hash.h" #include "../../msg_hash.h"
@ -26,10 +27,17 @@
cbs->action_cancel_ident = #name; cbs->action_cancel_ident = #name;
#endif #endif
/* Clicks the back button */
static int action_cancel_pop_default(const char *path, static int action_cancel_pop_default(const char *path,
const char *label, unsigned type, size_t idx) const char *label, unsigned type, size_t idx)
{ {
return menu_entry_go_back(); size_t new_selection_ptr;
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
menu_entries_pop_stack(&new_selection_ptr, 0, 1);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
return 0;
} }
static int action_cancel_core_content(const char *path, static int action_cancel_core_content(const char *path,

View File

@ -33,18 +33,6 @@
* notify_list_loaded on the UI companion. * notify_list_loaded on the UI companion.
*/ */
/* Clicks the back button */
int menu_entry_go_back(void)
{
size_t new_selection_ptr;
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
menu_entries_pop_stack(&new_selection_ptr, 0, 1);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
return 0;
}
enum menu_entry_type menu_entry_get_type(uint32_t i) enum menu_entry_type menu_entry_get_type(uint32_t i)
{ {
rarch_setting_t *setting = menu_entries_get_setting(i); rarch_setting_t *setting = menu_entries_get_setting(i);

View File

@ -53,8 +53,6 @@ typedef struct menu_entry
unsigned spacing; unsigned spacing;
} menu_entry_t; } menu_entry_t;
int menu_entry_go_back(void);
enum menu_entry_type menu_entry_get_type(uint32_t i); enum menu_entry_type menu_entry_get_type(uint32_t i);
void menu_entry_get_path(uint32_t i, char *s, size_t len); void menu_entry_get_path(uint32_t i, char *s, size_t len);

View File

@ -1128,8 +1128,10 @@ static int menu_input_pointer_post_iterate(
{ {
if (!pointer_oldback) if (!pointer_oldback)
{ {
size_t selection;
pointer_oldback = true; pointer_oldback = true;
menu_entry_go_back(); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
menu_entry_action(entry, selection, MENU_ACTION_CANCEL);
} }
} }

View File

@ -761,7 +761,9 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)menuBack - (void)menuBack
{ {
menu_entry_go_back(); size_t selection;
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
menu_entry_action(entry, selection, MENU_ACTION_CANCEL);
} }
@end @end