diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-12 10:45:34 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-12 10:45:34 +0000 |
commit | 6581146eb110b5b19e1492a1912379ba2eb9b49d (patch) | |
tree | 3fe4d1fbe43ebf435ccf2ad45f57f248f82afeae | |
parent | 972b2dbcab9aa5cf24dcc51d8a5744306f6248a9 (diff) | |
download | rockbox-6581146eb110b5b19e1492a1912379ba2eb9b49d.tar.gz rockbox-6581146eb110b5b19e1492a1912379ba2eb9b49d.zip |
Fix dircache not saving the last size (Caused the Scanning disk splash
to show every bot).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11734 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/misc.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 24 |
3 files changed, 17 insertions, 12 deletions
diff --git a/apps/main.c b/apps/main.c index 1d590286e2..a107d1cdd0 100644 --- a/apps/main.c +++ b/apps/main.c @@ -161,8 +161,9 @@ int init_dircache(bool preinit) { backlight_on(); show_logo(); - settings_save(); } + global_settings.dircache_size = dircache_get_cache_size(); + settings_save(); } return result; diff --git a/apps/misc.c b/apps/misc.c index 4ea8568018..75c4910d40 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -555,8 +555,8 @@ bool settings_parseline(char* line, char** name, char** value) static void system_flush(void) { - call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ tree_flush(); + call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ } static void system_restore(void) diff --git a/apps/tree.c b/apps/tree.c index 17da91d72b..29bf75d074 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1437,20 +1437,24 @@ void tree_flush(void) #endif #ifdef HAVE_DIRCACHE - if (global_settings.dircache) { - global_settings.dircache_size = dircache_get_cache_size(); + int old_val = global_settings.dircache_size; + if (global_settings.dircache) + { + global_settings.dircache_size = dircache_get_cache_size(); # ifdef HAVE_EEPROM_SETTINGS - if (dircache_is_enabled() && firmware_settings.initialized) - dircache_save(DIRCACHE_FILE); + if (dircache_is_enabled() && firmware_settings.initialized) + dircache_save(DIRCACHE_FILE); # endif - dircache_disable(); - } - else - { - global_settings.dircache_size = 0; + dircache_disable(); + } + else + { + global_settings.dircache_size = 0; + } + if (old_val != global_settings.dircache_size) + settings_save(); } - settings_save(); #endif } |