Do a transparent dircache rebuilding even if the rebuilding was
interrupted last time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7642 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
074b73856b
commit
57b25ca640
1 changed files with 21 additions and 2 deletions
23
apps/tree.c
23
apps/tree.c
|
@ -1638,8 +1638,11 @@ void tree_flush(void)
|
||||||
#ifdef HAVE_DIRCACHE
|
#ifdef HAVE_DIRCACHE
|
||||||
if (global_settings.dircache)
|
if (global_settings.dircache)
|
||||||
{
|
{
|
||||||
global_settings.dircache_size = dircache_get_cache_size();
|
if (dircache_is_enabled())
|
||||||
dircache_disable();
|
{
|
||||||
|
global_settings.dircache_size = dircache_get_cache_size();
|
||||||
|
dircache_disable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1651,10 +1654,26 @@ void tree_flush(void)
|
||||||
|
|
||||||
void tree_restore(void)
|
void tree_restore(void)
|
||||||
{
|
{
|
||||||
|
int font_w, font_h;
|
||||||
|
|
||||||
tagdb_init();
|
tagdb_init();
|
||||||
rundb_init();
|
rundb_init();
|
||||||
#ifdef HAVE_DIRCACHE
|
#ifdef HAVE_DIRCACHE
|
||||||
if (global_settings.dircache)
|
if (global_settings.dircache)
|
||||||
|
{
|
||||||
|
/* Print "Scanning disk..." to the display. */
|
||||||
|
lcd_getstringsize("A", &font_w, &font_h);
|
||||||
|
lcd_putsxy((LCD_WIDTH/2) - ((strlen(str(LANG_DIRCACHE_BUILDING))*font_w)/2),
|
||||||
|
LCD_HEIGHT-font_h*3, str(LANG_DIRCACHE_BUILDING));
|
||||||
|
lcd_update();
|
||||||
|
|
||||||
dircache_build(global_settings.dircache_size);
|
dircache_build(global_settings.dircache_size);
|
||||||
|
|
||||||
|
/* Clean the text when we are done. */
|
||||||
|
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||||
|
lcd_fillrect(0, LCD_HEIGHT-font_h*3, LCD_WIDTH, font_h);
|
||||||
|
lcd_set_drawmode(DRMODE_SOLID);
|
||||||
|
lcd_update();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue