(file_list) Directly access member variables instead of going through small

functions
This commit is contained in:
twinaphex 2019-05-13 04:27:03 +02:00
parent 63d9d4e2d3
commit ea6f818784
4 changed files with 9 additions and 7 deletions

View File

@ -677,10 +677,11 @@ static void menu_action_setting_disp_set_label_entry_url(
const char *path,
char *s2, size_t len2)
{
const char *representation_label = NULL;
const char *representation_label = list->list[i].alt
? list->list[i].alt
: list->list[i].path;
*s = '\0';
*w = 8;
file_list_get_alt_at_offset(list, i, &representation_label);
if (!string_is_empty(representation_label))
strlcpy(s2, representation_label, len2);

View File

@ -242,9 +242,9 @@ static int action_left_mainmenu(unsigned type, const char *label,
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(selection_buf,
selection) : NULL;
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)
selection_buf->list[selection].actiondata : NULL;
list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = MENU_ACTION_LEFT;

View File

@ -219,7 +219,7 @@ static int action_right_goto_tab(void)
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs = selection_buf ? (menu_file_list_cbs_t*)
file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;
selection_buf->list[selection].actiondata : NULL;
list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = MENU_ACTION_RIGHT;

View File

@ -877,7 +877,8 @@ void menu_input_post_iterate(int *ret, unsigned action)
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
size_t selection = menu_navigation_get_selection();
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;
(menu_file_list_cbs_t*)selection_buf->list[selection].actiondata
: NULL;
menu_entry_init(&entry);
menu_entry_get(&entry, 0, selection, NULL, false);