Skip to content

Commit

Permalink
Show License in Core Information menu
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 8, 2014
1 parent ee963d8 commit b42ed89
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ core_info_list_t *core_info_list_new(const char *modules_path)
core_info[i].permissions_list =
string_split(core_info[i].permissions, "|");

if (config_get_string(core_info[i].data, "license",
&core_info[i].licenses) &&
core_info[i].licenses)
core_info[i].licenses_list =
string_split(core_info[i].licenses, "|");

if (config_get_string(core_info[i].data, "notes",
&core_info[i].notes) &&
core_info[i].notes)
Expand Down Expand Up @@ -213,12 +219,14 @@ void core_info_list_free(core_info_list_t *core_info_list)
free(info->supported_extensions);
free(info->authors);
free(info->permissions);
free(info->licenses);
free(info->notes);
if (info->supported_extensions_list)
string_list_free(info->supported_extensions_list);
string_list_free(info->authors_list);
string_list_free(info->note_list);
string_list_free(info->permissions_list);
string_list_free(info->licenses_list);
config_file_free(info->data);

for (j = 0; j < info->firmware_count; j++)
Expand Down
2 changes: 2 additions & 0 deletions core_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ typedef struct
char *supported_extensions;
char *authors;
char *permissions;
char *licenses;
char *notes;
struct string_list *note_list;
struct string_list *supported_extensions_list;
struct string_list *authors_list;
struct string_list *permissions_list;
struct string_list *licenses_list;

core_info_firmware_t *firmware;
size_t firmware_count;
Expand Down
9 changes: 9 additions & 0 deletions frontend/menu/menu_entries.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ int menu_entries_push_list(menu_handle_t *menu,
MENU_SETTINGS_CORE_INFO_NONE, 0);
}

if (info->licenses_list)
{
strlcpy(tmp, "License(s): ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
info->licenses_list, ", ");
file_list_push(list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
}

if (info->supported_extensions_list)
{
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
Expand Down

0 comments on commit b42ed89

Please sign in to comment.