summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/apps/tree.c b/apps/tree.c
index d39c279763..d8ecfb243e 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -947,26 +947,6 @@ static bool handle_on(int* ds, int* dc, int numentries, int tree_max_on_screen)
return used;
}
-static void storefile(char* filename, char* setting, int maxlen)
-{
- int len = strlen(filename);
- int extlen = 0;
- char* ptr = filename + len;
-
- while (*ptr != '.') {
- extlen++;
- ptr--;
- }
-
- if (strcmp(ROCKBOX_DIR, currdir) || (len-extlen > maxlen))
- return;
-
- strncpy(setting, filename, len-extlen);
- setting[len-extlen]=0;
-
- settings_save();
-}
-
bool dirbrowse(char *root)
{
int numentries=0;
@@ -1117,8 +1097,8 @@ bool dirbrowse(char *root)
/* wps config file */
case TREE_ATTR_WPS:
wps_load(buf,true);
- storefile(file->name, global_settings.wps_file,
- MAX_FILENAME);
+ set_file(buf, global_settings.wps_file,
+ MAX_FILENAME);
restore = true;
break;
@@ -1152,10 +1132,10 @@ bool dirbrowse(char *root)
case TREE_ATTR_LNG:
if(!lang_load(buf)) {
- storefile(file->name,
- global_settings.lang_file,
- MAX_FILENAME);
-
+ set_file(file->name,
+ global_settings.lang_file,
+ MAX_FILENAME);
+
lcd_clear_display();
#ifdef HAVE_LCD_CHARCELLS
lcd_puts(0, 0, str(LANG_LANGUAGE_LOADED));
@@ -1179,8 +1159,8 @@ bool dirbrowse(char *root)
#ifdef HAVE_LCD_BITMAP
case TREE_ATTR_FONT:
font_load(buf);
- storefile(file->name, global_settings.font_file,
- MAX_FILENAME);
+ set_file(file->name, global_settings.font_file,
+ MAX_FILENAME);
lcd_getstringsize("A", &fw, &fh);
tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;