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
This commit is contained in:
parent
972b2dbcab
commit
6581146eb1
3 changed files with 17 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
24
apps/tree.c
24
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();
|
||||
dircache_disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
global_settings.dircache_size = 0;
|
||||
}
|
||||
if (old_val != global_settings.dircache_size)
|
||||
settings_save();
|
||||
}
|
||||
else
|
||||
{
|
||||
global_settings.dircache_size = 0;
|
||||
}
|
||||
settings_save();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue