Refactor away menu_navigation_set_last

This commit is contained in:
twinaphex 2015-09-25 14:42:28 +02:00
parent 4d2bbc9a3c
commit 14c463dae2
3 changed files with 2 additions and 24 deletions

View File

@ -133,7 +133,7 @@ static int action_right_scroll(unsigned type, const char *label,
else
{
if ((menu_list_get_size(menu_list) > 0))
menu_navigation_set_last(nav);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_LAST, NULL);
}
return 0;

View File

@ -114,6 +114,7 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
}
return true;
case MENU_NAVIGATION_CTL_SET_LAST:
nav->selection_ptr = menu_list_get_size(menu_list) - 1;
if (driver->navigation_set_last)
driver->navigation_set_last();
return true;
@ -177,22 +178,6 @@ void menu_navigation_set(menu_navigation_t *nav,
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll);
}
/**
* menu_navigation_set_last:
*
* Sets navigation pointer to last index.
**/
void menu_navigation_set_last(menu_navigation_t *nav)
{
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu_list || !nav)
return;
nav->selection_ptr = menu_list_get_size(menu_list) - 1;
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_LAST, NULL);
}
/**
* menu_navigation_descend_alphabet:
* @ptr_out : Amount of indices to 'scroll' to get

View File

@ -72,13 +72,6 @@ void menu_navigation_clear(menu_navigation_t *nav, bool pending_push);
**/
void menu_navigation_set(menu_navigation_t *nav, size_t i, bool scroll);
/**
* menu_navigation_set_last:
*
* Sets navigation pointer to last index.
**/
void menu_navigation_set_last(menu_navigation_t *nav);
/**
* menu_navigation_descend_alphabet:
* @ptr_out : Amount of indices to 'scroll' to get