summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/tagtree.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 8e7b868dbc..7887ee1c36 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1248,7 +1248,7 @@ static void tagtree_unload(struct tree_context *c)
1248 tree_unlock_cache(c); 1248 tree_unlock_cache(c);
1249} 1249}
1250 1250
1251void tagtree_init(void) 1251static bool initialize_tagtree(void) /* also used when user selects 'Reload' in 'custom view'*/
1252{ 1252{
1253 max_history_level = 0; 1253 max_history_level = 0;
1254 format_count = 0; 1254 format_count = 0;
@@ -1269,7 +1269,7 @@ void tagtree_init(void)
1269 if (!parse_menu(tagnavi_file)) 1269 if (!parse_menu(tagnavi_file))
1270 { 1270 {
1271 tagtree_unload(NULL); 1271 tagtree_unload(NULL);
1272 return; 1272 return false;
1273 } 1273 }
1274 1274
1275 /* safety check since tree.c needs to cast tagentry to entry */ 1275 /* safety check since tree.c needs to cast tagentry to entry */
@@ -1286,6 +1286,12 @@ void tagtree_init(void)
1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event); 1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event);
1287 1287
1288 core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used); 1288 core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used);
1289 return true;
1290}
1291
1292void tagtree_init(void)
1293{
1294 initialize_tagtree();
1289} 1295}
1290 1296
1291static bool show_search_progress(bool init, int count) 1297static bool show_search_progress(bool init, int count)
@@ -1815,7 +1821,8 @@ int tagtree_load(struct tree_context* c)
1815 { 1821 {
1816 splash(HZ, str(LANG_WAIT)); 1822 splash(HZ, str(LANG_WAIT));
1817 tagtree_unload(c); 1823 tagtree_unload(c);
1818 tagtree_init(); 1824 if (!initialize_tagtree())
1825 return 0;
1819 } 1826 }
1820 c->dirlevel = 0; 1827 c->dirlevel = 0;
1821 count = load_root(c); 1828 count = load_root(c);