From f1bf9e72861b7eec7cc3e48c1c07e2986bef6902 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 23 Aug 2002 22:15:51 +0000 Subject: Now doesn't try to play non-mp3/m3u files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1960 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/tree.c b/apps/tree.c index d7cb7fbe33..9dae3229e2 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -278,14 +278,16 @@ static int showdir(char *path, int start) #ifdef HAVE_LCD_BITMAP if ( dircache[i].attr & ATTR_DIRECTORY ) icon_type = Folder; - else { - if ( dircache[i].attr & TREE_ATTR_M3U ) - icon_type = Playlist; - else - icon_type = File; - } - lcd_bitmap(bitmap_icons_6x8[icon_type], - 4, MARGIN_Y+(i-start)*line_height, 6, 8, true); + else if ( dircache[i].attr & TREE_ATTR_M3U ) + icon_type = Playlist; + else if ( dircache[i].attr & TREE_ATTR_MP3 ) + icon_type = File; + else + icon_type = 0; + + if (icon_type) + lcd_bitmap(bitmap_icons_6x8[icon_type], + 4, MARGIN_Y+(i-start)*line_height, 6, 8, true); #endif @@ -526,7 +528,7 @@ bool dirbrowse(char *root) 0, seed ); start_index = 0; } - else { + else if (dircache[dircursor+start].attr & TREE_ATTR_MP3 ) { if ( global_settings.resume ) strncpy(global_settings.resume_file, currdir, MAX_PATH); @@ -537,6 +539,8 @@ bool dirbrowse(char *root) start_index = play_list(currdir, NULL, start_index, false, 0, seed); } + else + break; if ( global_settings.resume ) { /* the resume_index must always be the index in the -- cgit v1.2.3