diff options
author | Alexander Levin <al.le@gmx.de> | 2012-03-02 20:33:13 +0100 |
---|---|---|
committer | Alexander Levin <al.le@gmx.de> | 2012-03-16 22:26:13 +0100 |
commit | 7676dae3e0f279d4b193f1c9abf8977c8f52e5d2 (patch) | |
tree | 56989be5ea4ddb15618a060dc2b0afbdc996f29a | |
parent | e07b22f27e4fb23355d96e840252753be8b2ba39 (diff) | |
download | rockbox-7676dae3e0f279d4b193f1c9abf8977c8f52e5d2.tar.gz rockbox-7676dae3e0f279d4b193f1c9abf8977c8f52e5d2.zip |
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
-rw-r--r-- | apps/root_menu.c | 6 | ||||
-rw-r--r-- | apps/settings.h | 4 | ||||
-rw-r--r-- | apps/settings_list.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index 6e3164cf04..3f2e933461 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -549,7 +549,7 @@ void root_menu_load_from_cfg(void* setting, char *value) | |||
549 | if (!main_menu_added) | 549 | if (!main_menu_added) |
550 | root_menu__[menu_item_count++] = (struct menu_item_ex *)&menu_; | 550 | root_menu__[menu_item_count++] = (struct menu_item_ex *)&menu_; |
551 | root_menu_.flags |= MENU_ITEM_COUNT(menu_item_count); | 551 | root_menu_.flags |= MENU_ITEM_COUNT(menu_item_count); |
552 | *(int*)setting = 1; | 552 | *(bool*)setting = true; |
553 | } | 553 | } |
554 | 554 | ||
555 | char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len) | 555 | 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) | |||
586 | root_menu__[i] = (struct menu_item_ex *)menu_table[i].item; | 586 | root_menu__[i] = (struct menu_item_ex *)menu_table[i].item; |
587 | } | 587 | } |
588 | root_menu_.flags |= MENU_ITEM_COUNT(MAX_MENU_ITEMS); | 588 | root_menu_.flags |= MENU_ITEM_COUNT(MAX_MENU_ITEMS); |
589 | *(int*)setting = 0; | 589 | *(bool*)setting = false; |
590 | } | 590 | } |
591 | 591 | ||
592 | bool root_menu_is_changed(void* setting, void* defaultval) | 592 | bool root_menu_is_changed(void* setting, void* defaultval) |
593 | { | 593 | { |
594 | (void)defaultval; | 594 | (void)defaultval; |
595 | return *(int*)setting != 0; | 595 | return *(bool*)setting; |
596 | } | 596 | } |
597 | 597 | ||
598 | static int item_callback(int action, const struct menu_item_ex *this_item) | 598 | static int item_callback(int action, const struct menu_item_ex *this_item) |
diff --git a/apps/settings.h b/apps/settings.h index a55ab0c8b6..012e289d0c 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -823,8 +823,8 @@ struct user_settings | |||
823 | #endif | 823 | #endif |
824 | 824 | ||
825 | char start_directory[MAX_PATHNAME+1]; | 825 | char start_directory[MAX_PATHNAME+1]; |
826 | /* status setting for the root menu customisability. 0 = default, 1 = loaded from cfg */ | 826 | /* Has the root been customized from the .cfg file? false = no, true = loaded from cfg */ |
827 | int root_menu; | 827 | bool root_menu_customized; |
828 | }; | 828 | }; |
829 | 829 | ||
830 | /** global variables **/ | 830 | /** global variables **/ |
diff --git a/apps/settings_list.c b/apps/settings_list.c index 27cece5550..2258582a78 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1921,7 +1921,7 @@ const struct settings_list settings[] = { | |||
1921 | "resume rewind", UNIT_SEC, 0, 60, 5, | 1921 | "resume rewind", UNIT_SEC, 0, 60, 5, |
1922 | NULL, NULL, NULL), | 1922 | NULL, NULL, NULL), |
1923 | #endif | 1923 | #endif |
1924 | CUSTOM_SETTING(0, root_menu, | 1924 | CUSTOM_SETTING(0, root_menu_customized, |
1925 | LANG_ROCKBOX_TITLE, /* lang string here is never actually used */ | 1925 | LANG_ROCKBOX_TITLE, /* lang string here is never actually used */ |
1926 | NULL, "root menu order", | 1926 | NULL, "root menu order", |
1927 | root_menu_load_from_cfg, root_menu_write_to_cfg, | 1927 | root_menu_load_from_cfg, root_menu_write_to_cfg, |