Index: rockbox-cvs/apps/settings.c =================================================================== RCS file: /cvsroot/rockbox/apps/settings.c,v retrieving revision 1.205 diff -u -r1.205 settings.c --- rockbox-cvs/apps/settings.c 19 Jun 2004 15:50:02 -0000 1.205 +++ rockbox-cvs/apps/settings.c 19 Jun 2004 21:31:21 -0000 @@ -85,6 +85,9 @@ long lasttime = 0; static unsigned char config_block[CONFIG_BLOCK_SIZE]; +/* oscar */ +const char* dirconfig_load_name = "_dirconfig.cfg"; + /* descriptor for a configuration value */ /* (watch the struct packing and member sizes to keep this small) */ @@ -1048,6 +1051,9 @@ char line[128]; int restore[6]; /* recover, FIXME: get rid of this */ +/* oscar */ +DEBUGF("settings_load_config from file: %s\n", file); + fd = open(file, O_RDONLY); if (fd < 0) return false; Index: rockbox-cvs/apps/settings.h =================================================================== RCS file: /cvsroot/rockbox/apps/settings.h,v retrieving revision 1.109 diff -u -r1.109 settings.h --- rockbox-cvs/apps/settings.h 19 Jun 2004 15:50:02 -0000 1.109 +++ rockbox-cvs/apps/settings.h 19 Jun 2004 21:31:22 -0000 @@ -33,6 +33,10 @@ #define MAX_FILENAME 20 +/* oscar */ +extern const char* dirconfig_load_name; + + /* data structures */ #define RESUME_OFF 0 Index: rockbox-cvs/apps/tree.c =================================================================== RCS file: /cvsroot/rockbox/apps/tree.c,v retrieving revision 1.245 diff -u -r1.245 tree.c --- rockbox-cvs/apps/tree.c 21 May 2004 20:04:43 -0000 1.245 +++ rockbox-cvs/apps/tree.c 19 Jun 2004 21:31:25 -0000 @@ -251,6 +251,30 @@ } +/* start patch oscar */ +static int dirconfig_load_settings(char *dir) +{ + int fd; + char dirconfig_filename[MAX_PATH+1]; + + snprintf(dirconfig_filename, sizeof(dirconfig_filename), "%s/%s", + dir, dirconfig_load_name); + + DEBUGF("Checking for %s\n", dirconfig_filename); + + fd = open(dirconfig_filename, O_RDONLY); + if (fd < 0) { + DEBUGF("...no such file\n"); + return -1; + } + close(fd); + + DEBUGF("...found\n"); + return (settings_load_config(dirconfig_filename)); +} +/* end patch oscar */ + + static int compare(const void* p1, const void* p2) { struct entry* e1 = (struct entry*)p1; @@ -445,6 +469,16 @@ /* new dir? cache it */ if (strncmp(path,lastdir,sizeof(lastdir)) || reload_dir) { + +/* start patch oscar */ +DEBUGF("We enter a new directory: %s\n", path); +dirconfig_load_settings(path); +#ifdef HAVE_LCD_BITMAP + tree_max_on_screen = recalc_screen_height(); +#endif + +/* end patch oscar */ + if (!load_and_sort_directory(path, dirfilter, &filesindir, &dir_buffer_full)) return -1; @@ -1030,7 +1064,7 @@ if (global_settings.talk_dir == 3) /* enter */ { /* play_dirname */ - DEBUGF("Playing directory thumbnail: %s", currdir); + DEBUGF("Playing directory thumbnail: %s\n", currdir); play_dirname(dircursor+dirstart); /* avoid reading getting cut by next filename */ enqueue_next = true;