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 | |
parent | 361aaf6acd1881141d681bded83575320be7feb5 (diff) | |
download | rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.tar.gz rockbox-b3f59c41726a6f48d5f12bfe105e1ef2c8bcaf3c.zip |
Removed some silly code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@772 a1c6a512-1295-4272-9138-f99709370657
-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 a7f871caa1..a74045f1af 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -117,29 +117,25 @@ static int showdir(char *path, int start) | |||
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) { | 119 | for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) { |
120 | if ( i < filesindir ) { | 120 | int len = strlen(buffer[i].name); |
121 | int len = strlen(buffer[i].name); | ||
122 | 121 | ||
123 | #ifdef HAVE_LCD_BITMAP | 122 | #ifdef HAVE_LCD_BITMAP |
124 | if ( buffer[i].file ) | 123 | if ( buffer[i].file ) |
125 | icon_type=File; | 124 | icon_type=File; |
126 | else | 125 | else |
127 | icon_type=Folder; | 126 | icon_type=Folder; |
128 | lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, | 127 | lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, |
129 | 8, true); | 128 | 8, true); |
130 | #endif | 129 | #endif |
131 | 130 | ||
132 | if(len < TREE_MAX_LEN_DISPLAY) | 131 | if(len < TREE_MAX_LEN_DISPLAY) |
133 | lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); | 132 | lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); |
134 | else { | 133 | else { |
135 | char storage = buffer[i].name[TREE_MAX_LEN_DISPLAY]; | 134 | char storage = buffer[i].name[TREE_MAX_LEN_DISPLAY]; |
136 | buffer[i].name[TREE_MAX_LEN_DISPLAY]=0; | 135 | buffer[i].name[TREE_MAX_LEN_DISPLAY]=0; |
137 | lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); | 136 | lcd_puts(LINE_X, LINE_Y+i-start, buffer[i].name); |
138 | buffer[i].name[TREE_MAX_LEN_DISPLAY]=storage; | 137 | buffer[i].name[TREE_MAX_LEN_DISPLAY]=storage; |
139 | } | ||
140 | } | 138 | } |
141 | else | ||
142 | lcd_puts(LINE_X, LINE_Y+i-start," "); | ||
143 | } | 139 | } |
144 | 140 | ||
145 | return filesindir; | 141 | return filesindir; |
@@ -176,13 +172,7 @@ bool dirbrowse(char *root) | |||
176 | #endif | 172 | #endif |
177 | 173 | ||
178 | while(1) { | 174 | while(1) { |
179 | int key = button_get(); | 175 | switch(button_get(true)) { |
180 | |||
181 | if(!key) { | ||
182 | sleep(1); | ||
183 | continue; | ||
184 | } | ||
185 | switch(key) { | ||
186 | #if defined(SIMULATOR) && defined(HAVE_RECODER_KEYPAD) | 176 | #if defined(SIMULATOR) && defined(HAVE_RECODER_KEYPAD) |
187 | case BUTTON_OFF: | 177 | case BUTTON_OFF: |
188 | return false; | 178 | return false; |