diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-19 09:47:31 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-19 09:47:31 +0000 |
| commit | 354a00627e530bd854e57126f28c67b77dfd52b6 (patch) | |
| tree | 1eb69412a3f22bf1562eae5f31dc5ac5c7e87b0f /apps | |
| parent | 93d8ca53c3b6dd0602b31131da0a6f814ec73ca0 (diff) | |
| download | rockbox-354a00627e530bd854e57126f28c67b77dfd52b6.zip rockbox-354a00627e530bd854e57126f28c67b77dfd52b6.tar.gz rockbox-354a00627e530bd854e57126f28c67b77dfd52b6.tar.bz2 rockbox-354a00627e530bd854e57126f28c67b77dfd52b6.tar.xz | |
User now receives a message if initial directory cache initialization
fails.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7988 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/main.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/apps/main.c b/apps/main.c index 43ce9f4..a3fc267 100644 --- a/apps/main.c +++ b/apps/main.c @@ -99,6 +99,8 @@ void app_main(void) void init_dircache(void) { int font_w, font_h; + int result; + char buf[32]; dircache_init(); if (global_settings.dircache) @@ -109,13 +111,24 @@ void init_dircache(void) 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(); + result = dircache_build(global_settings.dircache_size); + if (result < 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); + } + else + { + /* 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(); + } } } #else |