summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-10-19 11:34:32 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-10-19 11:34:32 +0000
commit57b25ca640332a262c046693425ad0810853b070 (patch)
tree4200ec6538791e6717a20f800637a51249c6b8ee /apps
parent074b73856b9013c702350319e134c4fa0682c508 (diff)
downloadrockbox-57b25ca640332a262c046693425ad0810853b070.tar.gz
rockbox-57b25ca640332a262c046693425ad0810853b070.tar.bz2
rockbox-57b25ca640332a262c046693425ad0810853b070.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/tree.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c
index bfaf7b8304..b50ccb6ca6 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1638,8 +1638,11 @@ void tree_flush(void)
#ifdef HAVE_DIRCACHE
if (global_settings.dircache)
{
- global_settings.dircache_size = dircache_get_cache_size();
- dircache_disable();
+ if (dircache_is_enabled())
+ {
+ global_settings.dircache_size = dircache_get_cache_size();
+ dircache_disable();
+ }
}
else
{
@@ -1651,10 +1654,26 @@ void tree_flush(void)
void tree_restore(void)
{
+ int font_w, font_h;
+
tagdb_init();
rundb_init();
#ifdef HAVE_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);
+
+ /* 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
}