summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-08-30 21:07:46 +0000
committerThomas Martitz <kugel@rockbox.org>2011-08-30 21:07:46 +0000
commit7e14b935dfdcd808cfb0703d19a43efd11eeef16 (patch)
tree57834f71db1bbaaabf7872d8609f8254371377cf /apps
parentc1ae789108942f3270fb90bd5a088adfee126333 (diff)
downloadrockbox-7e14b935dfdcd808cfb0703d19a43efd11eeef16.tar.gz
rockbox-7e14b935dfdcd808cfb0703d19a43efd11eeef16.tar.bz2
rockbox-7e14b935dfdcd808cfb0703d19a43efd11eeef16.zip
Dircache: Allow dircache to be enabled without reboot.
Also add two dircache function, one of which does what dircache_disable() did previously as this now also frees the dircache buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30393 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/menus/settings_menu.c16
-rw-r--r--apps/tagcache.c2
-rw-r--r--apps/tree.c2
3 files changed, 9 insertions, 11 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;
}
diff --git a/apps/tagcache.c b/apps/tagcache.c
index e3f2f4fe68..8d522b1536 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -3099,7 +3099,7 @@ static bool commit(void)
#ifdef HAVE_DIRCACHE
/* Rebuild the dircache, if we stole the buffer. */
if (dircache_buffer_stolen)
- dircache_build(0);
+ dircache_resume();
#endif
#ifdef HAVE_TC_RAMCACHE
diff --git a/apps/tree.c b/apps/tree.c
index c7484ff420..24acd5ac69 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1216,7 +1216,7 @@ void tree_flush(void)
if (firmware_settings.initialized)
dircache_save();
# endif
- dircache_disable();
+ dircache_suspend();
}
else
{