summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-05-27 11:21:08 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-05-27 11:21:08 +0000
commit196b770a96920e93dff514b9173d290bf73d0a81 (patch)
treef8a972d7892fb2f152dc8d58a37f6dc7d41c7109 /apps/main.c
parent45975987b2a18b607c35e05aa7090f102246fdcc (diff)
downloadrockbox-196b770a96920e93dff514b9173d290bf73d0a81.zip
rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.gz
rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.bz2
rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.xz
Init dircache after applying settings and use a splash. Possible prevent
some type of buffer overflow with tagcache. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9997 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/apps/main.c b/apps/main.c
index 84c77ab..3878e3a 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -106,33 +106,25 @@ void init_dircache(void)
int font_w, font_h;
int result;
char buf[32];
+ bool clear = false;
dircache_init();
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();
-
- result = dircache_build(global_settings.dircache_size);
- if (result < 0)
+ if (global_settings.dircache_size == 0)
{
- snprintf(buf, sizeof(buf),
- "Failed! Result: %d",
- result);
- lcd_getstringsize("A", &font_w, &font_h);
- lcd_putsxy((LCD_WIDTH/2) - ((strlen(buf)*font_w)/2),
- LCD_HEIGHT-font_h*2, buf);
+ gui_syncsplash(0, true, str(LANG_DIRCACHE_BUILDING));
+ clear = true;
}
- else
+
+ result = dircache_build(global_settings.dircache_size);
+ if (result < 0)
+ gui_syncsplash(0, true, "Failed! Result: %d", result);
+
+ if (clear)
{
- /* 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();
+ backlight_on();
+ show_logo();
}
}
}
@@ -170,7 +162,10 @@ void init_tagcache(void)
tagtree_init();
if (clear)
+ {
+ backlight_on();
show_logo();
+ }
}
#ifdef SIMULATOR
@@ -389,9 +384,9 @@ void init(void)
settings_load(SETTINGS_ALL);
- init_dircache();
gui_sync_wps_init();
settings_apply();
+ init_dircache();
init_tagcache();
status_init();