From 60cfc95c1caf259e16da26059d897a36e525a576 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 17 Jun 2016 21:03:00 +0200 Subject: [PATCH] menu_entry_get - add enum_idx to member struct --- menu/menu_entry.c | 23 ++++++++++++++--------- menu/menu_entry.h | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/menu/menu_entry.c b/menu/menu_entry.c index f4e5d70fbe..4e7061201e 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -288,17 +288,22 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, cbs = menu_entries_get_actiondata_at_offset(list, i); - if (cbs && cbs->action_get_value && use_representation) + if (cbs) { - enum menu_hash_enums enum_idx = MENU_ENUM_LABEL_UNKNOWN; - const char *label = NULL; - menu_entries_get_last_stack(NULL, &label, NULL, &enum_idx, NULL); + entry->enum_idx = cbs->enum_idx; - cbs->action_get_value(list, - &entry->spacing, entry->type, i, label, - entry->value, sizeof(entry->value), - entry_label, path, - entry->path, sizeof(entry->path)); + if (cbs->action_get_value && use_representation) + { + enum menu_hash_enums enum_idx = MENU_ENUM_LABEL_UNKNOWN; + const char *label = NULL; + menu_entries_get_last_stack(NULL, &label, NULL, &enum_idx, NULL); + + cbs->action_get_value(list, + &entry->spacing, entry->type, i, label, + entry->value, sizeof(entry->value), + entry_label, path, + entry->path, sizeof(entry->path)); + } } entry->idx = i; diff --git a/menu/menu_entry.h b/menu/menu_entry.h index a19bb06769..77aa5281be 100644 --- a/menu/menu_entry.h +++ b/menu/menu_entry.h @@ -47,6 +47,7 @@ typedef struct menu_entry char label[PATH_MAX_LENGTH]; char value[PATH_MAX_LENGTH]; size_t entry_idx; + enum menu_hash_enums enum_idx; unsigned idx; unsigned type; unsigned spacing;