diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-10-07 17:38:05 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-10-07 17:38:05 +0000 |
| commit | ab78b0468088e9011273edc32d59145db9030a7e (patch) | |
| tree | 5dc785c1f3eec456592b210d1aad39b6f5cf6880 /apps/settings_menu.c | |
| parent | 86e31d5558704b8ab83d2e5d5c9dca691a5f768a (diff) | |
| download | rockbox-ab78b0468088e9011273edc32d59145db9030a7e.zip rockbox-ab78b0468088e9011273edc32d59145db9030a7e.tar.gz rockbox-ab78b0468088e9011273edc32d59145db9030a7e.tar.bz2 rockbox-ab78b0468088e9011273edc32d59145db9030a7e.tar.xz | |
Implemented directory caching. No more waiting for disk to spin up while
browsing when cache is enabled (system -> disk -> enable directory
cache). Cache building on boot is transparent except the first boot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7588 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
| -rw-r--r-- | apps/settings_menu.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 8a1fa72..6ad5274 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -49,6 +49,8 @@ #include "abrepeat.h" #include "power.h" #include "database.h" +#include "dir.h" +#include "dircache.h" #ifdef HAVE_LCD_BITMAP #include "peakmeter.h" @@ -1259,6 +1261,23 @@ static bool beep(void) } #endif +#ifdef HAVE_DIRCACHE +static bool dircache(void) +{ + bool result = set_bool(str(LANG_DIRCACHE_ENABLE), + &global_settings.dircache); + + if (!dircache_is_enabled() && global_settings.dircache) + splash(HZ*2, true, str(LANG_DIRCACHE_REBOOT)); + + if (!result) + dircache_disable(); + + return result; +} + +#endif /* HAVE_DIRCACHE */ + static bool playback_settings_menu(void) { int m; @@ -1574,6 +1593,9 @@ static bool disk_settings_menu(void) #ifdef HAVE_ATA_POWER_OFF { ID2P(LANG_POWEROFF), poweroff }, #endif +#ifdef HAVE_DIRCACHE + { ID2P(LANG_DIRCACHE_ENABLE), dircache }, +#endif }; m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |