diff options
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/tree.c b/apps/tree.c index eb1f7c3b74..b844060322 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -246,6 +246,8 @@ static int showdir(void) | |||
246 | int i; | 246 | int i; |
247 | int tree_max_on_screen; | 247 | int tree_max_on_screen; |
248 | bool dir_buffer_full = false; | 248 | bool dir_buffer_full = false; |
249 | int start = tc.dirstart; | ||
250 | bool id3db = global_settings.dirfilter == SHOW_ID3DB; | ||
249 | 251 | ||
250 | #ifdef HAVE_LCD_BITMAP | 252 | #ifdef HAVE_LCD_BITMAP |
251 | const char* icon; | 253 | const char* icon; |
@@ -259,8 +261,6 @@ static int showdir(void) | |||
259 | int icon; | 261 | int icon; |
260 | tree_max_on_screen = TREE_MAX_ON_SCREEN; | 262 | tree_max_on_screen = TREE_MAX_ON_SCREEN; |
261 | #endif | 263 | #endif |
262 | int start = tc.dirstart; | ||
263 | bool id3db = global_settings.dirfilter == SHOW_ID3DB; | ||
264 | 264 | ||
265 | /* new file dir? load it */ | 265 | /* new file dir? load it */ |
266 | if (id3db) { | 266 | if (id3db) { |
@@ -1332,16 +1332,16 @@ bool rockbox_browse(const char *root, int dirfilter) | |||
1332 | 1332 | ||
1333 | void tree_init(void) | 1333 | void tree_init(void) |
1334 | { | 1334 | { |
1335 | /* We copy the settings value in case it is changed by the user. We can't | ||
1336 | use it until the next reboot. */ | ||
1337 | int max_files = global_settings.max_files_in_dir; | ||
1338 | |||
1335 | /* initialize tree context struct */ | 1339 | /* initialize tree context struct */ |
1336 | memset(&tc, 0, sizeof(tc)); | 1340 | memset(&tc, 0, sizeof(tc)); |
1337 | tc.dirfilter = &global_settings.dirfilter; | 1341 | tc.dirfilter = &global_settings.dirfilter; |
1338 | 1342 | ||
1339 | db_init(); | 1343 | db_init(); |
1340 | 1344 | ||
1341 | /* We copy the settings value in case it is changed by the user. We can't | ||
1342 | use it until the next reboot. */ | ||
1343 | int max_files = global_settings.max_files_in_dir; | ||
1344 | |||
1345 | tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files; | 1345 | tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files; |
1346 | tc.name_buffer = buffer_alloc(tc.name_buffer_size); | 1346 | tc.name_buffer = buffer_alloc(tc.name_buffer_size); |
1347 | 1347 | ||