summaryrefslogtreecommitdiffstats
path: root/apps/menus
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/settings_menu.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index b3003bf5c2..82c91aa3c4 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -189,16 +189,14 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
switch (action)
{
case ACTION_EXIT_MENUITEM: /* on exit */
- switch (global_settings.dircache)
+ if (global_settings.dircache && !dircache_is_enabled())
{
- case true:
- if (!dircache_is_enabled())
- splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
- break;
- case false:
- if (dircache_is_enabled())
- dircache_disable();
- break;
+ if (dircache_build(0) < 0)
+ splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
+ }
+ else if (!global_settings.dircache && dircache_is_enabled())
+ {
+ dircache_disable();
}
break;
}