From 8ae29ff4b2552f6c91c9a1b55d82fb9d8452bf7d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 7 May 2002 11:46:37 +0000 Subject: is_dir() is removed, we now read the 'attribute' field from the dirent struct. This is supposed to work with the X11 simulator as of now, and I trust that the win32 one will grok this pretty soon too! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@491 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/tree.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/uisimulator/tree.c b/uisimulator/tree.c index d59718d17c..c8d15ac5b9 100644 --- a/uisimulator/tree.c +++ b/uisimulator/tree.c @@ -50,16 +50,6 @@ struct entry { #ifdef HAVE_LCD_BITMAP -bool is_dir(char* path) -{ - DIR* dir = opendir(path); - if(dir) { - closedir(dir); - return TRUE; - } - return FALSE; -} - int static showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end) { @@ -91,7 +81,7 @@ showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end) else memcpy(buffer[i].name, "too long", 9); - buffer[i].file = TRUE; /* files only for now */ + buffer[i].file = !(entry->attribute&ATTR_DIRECTORY); if(len < TREE_MAX_LEN_DISPLAY) lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0); @@ -191,7 +181,7 @@ bool dirbrowse(char *root) sprintf(buf,"%s/%s",currdir,buffer[dircursor].name); } - if (is_dir(buf)) { + if (!buffer[dircursor].file) { memcpy(currdir,buf,sizeof(currdir)); dircursor=0; start=0; -- cgit v1.2.3