forked from len0rd/rockbox
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
This commit is contained in:
parent
93d8ca53c3
commit
354a00627e
2 changed files with 21 additions and 8 deletions
17
apps/main.c
17
apps/main.c
|
@ -99,6 +99,8 @@ void app_main(void)
|
||||||
void init_dircache(void)
|
void init_dircache(void)
|
||||||
{
|
{
|
||||||
int font_w, font_h;
|
int font_w, font_h;
|
||||||
|
int result;
|
||||||
|
char buf[32];
|
||||||
|
|
||||||
dircache_init();
|
dircache_init();
|
||||||
if (global_settings.dircache)
|
if (global_settings.dircache)
|
||||||
|
@ -109,14 +111,25 @@ void init_dircache(void)
|
||||||
LCD_HEIGHT-font_h*3, str(LANG_DIRCACHE_BUILDING));
|
LCD_HEIGHT-font_h*3, str(LANG_DIRCACHE_BUILDING));
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
dircache_build(global_settings.dircache_size);
|
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. */
|
/* Clean the text when we are done. */
|
||||||
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||||
lcd_fillrect(0, LCD_HEIGHT-font_h*3, LCD_WIDTH, font_h);
|
lcd_fillrect(0, LCD_HEIGHT-font_h*3, LCD_WIDTH, font_h);
|
||||||
lcd_set_drawmode(DRMODE_SOLID);
|
lcd_set_drawmode(DRMODE_SOLID);
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define init_dircache(...)
|
# define init_dircache(...)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifdef HAVE_DIRCACHE
|
#ifdef HAVE_DIRCACHE
|
||||||
|
|
||||||
#define DIRCACHE_RESERVE (1024*64)
|
#define DIRCACHE_RESERVE (1024*64)
|
||||||
#define DIRCACHE_LIMIT (1024*1024*2)
|
#define DIRCACHE_LIMIT (1024*1024*3)
|
||||||
#define DIRCACHE_FILE ROCKBOX_DIR "/dircache.dat"
|
#define DIRCACHE_FILE ROCKBOX_DIR "/dircache.dat"
|
||||||
|
|
||||||
/* Internal structures. */
|
/* Internal structures. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue