diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-05-28 16:32:43 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-05-28 16:32:43 +0000 |
| commit | b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c (patch) | |
| tree | 055e8e068d0db8c2de5a8a424f5339fa8340229f /apps/tree.c | |
| parent | 361aaf6acd1881141d681bded83575320be7feb5 (diff) | |
| download | rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.zip rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.tar.gz rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.tar.bz2 rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.tar.xz | |
Removed some silly code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@772 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
| -rw-r--r-- | apps/tree.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/apps/tree.c b/apps/tree.c index a7f871c..a74045f 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -117,29 +117,25 @@ static int showdir(char *path, int start) #endif for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) { - if ( i < filesindir ) { - int len = strlen(buffer[i].name); + int len = strlen(buffer[i].name); #ifdef HAVE_LCD_BITMAP - if ( buffer[i].file ) - icon_type=File; - else - icon_type=Folder; - lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, - 8, true); + if ( buffer[i].file ) + icon_type=File; + else + icon_type=Folder; + lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, + 8, true); #endif - if(len < TREE_MAX_LEN_DISPLAY) - lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); - else { - char storage = buffer[i].name[TREE_MAX_LEN_DISPLAY]; - buffer[i].name[TREE_MAX_LEN_DISPLAY]=0; - lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); - buffer[i].name[TREE_MAX_LEN_DISPLAY]=storage; - } + if(len < TREE_MAX_LEN_DISPLAY) + lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); + else { + char storage = buffer[i].name[TREE_MAX_LEN_DISPLAY]; + buffer[i].name[TREE_MAX_LEN_DISPLAY]=0; + lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); + buffer[i].name[TREE_MAX_LEN_DISPLAY]=storage; } - else - lcd_puts(LINE_X, LINE_Y+i-start," "); } return filesindir; @@ -176,13 +172,7 @@ bool dirbrowse(char *root) #endif while(1) { - int key = button_get(); - - if(!key) { - sleep(1); - continue; - } - switch(key) { + switch(button_get(true)) { #if defined(SIMULATOR) && defined(HAVE_RECODER_KEYPAD) case BUTTON_OFF: return false; |