More meaningful name and type for 'root menu' setting

The patch changes 'int root_menu' to 'bool root_menu_customized'
which better expresses what the value means.

Change-Id: Ic272ac161fc05f5d3298e1e46578977dd590ebaf
This commit is contained in:
Alexander Levin 2012-03-02 20:33:13 +01:00
parent e07b22f27e
commit 7676dae3e0
3 changed files with 6 additions and 6 deletions

View file

@ -549,7 +549,7 @@ void root_menu_load_from_cfg(void* setting, char *value)
if (!main_menu_added) if (!main_menu_added)
root_menu__[menu_item_count++] = (struct menu_item_ex *)&menu_; root_menu__[menu_item_count++] = (struct menu_item_ex *)&menu_;
root_menu_.flags |= MENU_ITEM_COUNT(menu_item_count); root_menu_.flags |= MENU_ITEM_COUNT(menu_item_count);
*(int*)setting = 1; *(bool*)setting = true;
} }
char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len) char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len)
@ -586,13 +586,13 @@ void root_menu_set_default(void* setting, void* defaultval)
root_menu__[i] = (struct menu_item_ex *)menu_table[i].item; root_menu__[i] = (struct menu_item_ex *)menu_table[i].item;
} }
root_menu_.flags |= MENU_ITEM_COUNT(MAX_MENU_ITEMS); root_menu_.flags |= MENU_ITEM_COUNT(MAX_MENU_ITEMS);
*(int*)setting = 0; *(bool*)setting = false;
} }
bool root_menu_is_changed(void* setting, void* defaultval) bool root_menu_is_changed(void* setting, void* defaultval)
{ {
(void)defaultval; (void)defaultval;
return *(int*)setting != 0; return *(bool*)setting;
} }
static int item_callback(int action, const struct menu_item_ex *this_item) static int item_callback(int action, const struct menu_item_ex *this_item)

View file

@ -823,8 +823,8 @@ struct user_settings
#endif #endif
char start_directory[MAX_PATHNAME+1]; char start_directory[MAX_PATHNAME+1];
/* status setting for the root menu customisability. 0 = default, 1 = loaded from cfg */ /* Has the root been customized from the .cfg file? false = no, true = loaded from cfg */
int root_menu; bool root_menu_customized;
}; };
/** global variables **/ /** global variables **/

View file

@ -1921,7 +1921,7 @@ const struct settings_list settings[] = {
"resume rewind", UNIT_SEC, 0, 60, 5, "resume rewind", UNIT_SEC, 0, 60, 5,
NULL, NULL, NULL), NULL, NULL, NULL),
#endif #endif
CUSTOM_SETTING(0, root_menu, CUSTOM_SETTING(0, root_menu_customized,
LANG_ROCKBOX_TITLE, /* lang string here is never actually used */ LANG_ROCKBOX_TITLE, /* lang string here is never actually used */
NULL, "root menu order", NULL, "root menu order",
root_menu_load_from_cfg, root_menu_write_to_cfg, root_menu_load_from_cfg, root_menu_write_to_cfg,