summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/tree.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 12acdc8c70..797fbe0862 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -408,11 +408,13 @@ static int showdir(void)
408 start + tc.firstpos + tree_max_on_screen, VERTICAL); 408 start + tc.firstpos + tree_max_on_screen, VERTICAL);
409 409
410#if CONFIG_KEYPAD == RECORDER_PAD 410#if CONFIG_KEYPAD == RECORDER_PAD
411 if(global_settings.buttonbar) { 411 if (global_settings.buttonbar) {
412 buttonbar_set(*tc.dirfilter < NUM_FILTER_MODES ? 412 if (*tc.dirfilter < NUM_FILTER_MODES)
413 str(LANG_DIRBROWSE_F1) : (unsigned char *) "", 413 buttonbar_set(str(LANG_DIRBROWSE_F1),
414 str(LANG_DIRBROWSE_F2), 414 str(LANG_DIRBROWSE_F2),
415 str(LANG_DIRBROWSE_F3)); 415 str(LANG_DIRBROWSE_F3));
416 else
417 buttonbar_set("<<<", "", "");
416 buttonbar_draw(); 418 buttonbar_draw();
417 } 419 }
418#endif 420#endif
@@ -1001,6 +1003,8 @@ static bool dirbrowse(void)
1001 1003
1002 id3db = check_changed_id3mode(id3db); 1004 id3db = check_changed_id3mode(id3db);
1003 } 1005 }
1006 else /* use it as a quick exit instead */
1007 exit_func = true;
1004 break; 1008 break;
1005 1009
1006 case TREE_WPS: 1010 case TREE_WPS:
@@ -1134,7 +1138,7 @@ static bool dirbrowse(void)
1134 might be confusing to the user */ 1138 might be confusing to the user */
1135 exit_func = true; 1139 exit_func = true;
1136 else 1140 else
1137 reload_root = true; 1141 reload_dir = true;
1138 } 1142 }
1139 break; 1143 break;
1140 } 1144 }
@@ -1149,7 +1153,7 @@ static bool dirbrowse(void)
1149 { 1153 {
1150 lcd_stop_scroll(); 1154 lcd_stop_scroll();
1151 if (wps_show() == SYS_USB_CONNECTED) 1155 if (wps_show() == SYS_USB_CONNECTED)
1152 reload_root = true; 1156 reload_dir = true;
1153#ifdef HAVE_HOTSWAP 1157#ifdef HAVE_HOTSWAP
1154 else 1158 else
1155 if (!id3db) /* Try reload to catch 'no longer valid' case. */ 1159 if (!id3db) /* Try reload to catch 'no longer valid' case. */
@@ -1163,9 +1167,7 @@ static bool dirbrowse(void)
1163 start_wps=false; 1167 start_wps=false;
1164 } 1168 }
1165 1169
1166#ifdef HAVE_HOTSWAP
1167 check_rescan: 1170 check_rescan:
1168#endif
1169 /* do we need to rescan dir? */ 1171 /* do we need to rescan dir? */
1170 if (reload_dir || reload_root || 1172 if (reload_dir || reload_root ||
1171 lastfilter != *tc.dirfilter || 1173 lastfilter != *tc.dirfilter ||
@@ -1202,7 +1204,7 @@ static bool dirbrowse(void)
1202#ifdef HAVE_LCD_BITMAP 1204#ifdef HAVE_LCD_BITMAP
1203 tree_max_on_screen = recalc_screen_height(); 1205 tree_max_on_screen = recalc_screen_height();
1204#endif 1206#endif
1205 1207
1206 /* We need to adjust if the number of lines on screen have 1208 /* We need to adjust if the number of lines on screen have
1207 changed because of a status bar change */ 1209 changed because of a status bar change */
1208 if(CURSOR_Y+LINE_Y+tc.dircursor>tree_max_on_screen) { 1210 if(CURSOR_Y+LINE_Y+tc.dircursor>tree_max_on_screen) {
@@ -1216,14 +1218,12 @@ static bool dirbrowse(void)
1216 lcd_setfont(FONT_UI); 1218 lcd_setfont(FONT_UI);
1217#endif 1219#endif
1218 numentries = showdir(); 1220 numentries = showdir();
1219#ifdef HAVE_HOTSWAP 1221 if (currdir[1] && (numentries < 0))
1220 if (currdir[1] && (numentries < 0))
1221 { /* not in root and reload failed */ 1222 { /* not in root and reload failed */
1222 reload_root = true; /* try root */ 1223 reload_root = true; /* try root */
1223 reload_dir = false; 1224 reload_dir = false;
1224 goto check_rescan; 1225 goto check_rescan;
1225 } 1226 }
1226#endif
1227 update_all = true; 1227 update_all = true;
1228 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true); 1228 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true);
1229 1229