From 98c9f959e53536a0b63d0376fad198ef883c5c03 Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Tue, 15 Aug 2006 22:14:35 +0000 Subject: Clear file view title if the user turns it off. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10596 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 8 ++++++-- apps/tree.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 0d8b4d1..c952f96 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -525,11 +525,15 @@ void gui_list_screen_scroll_out_of_view(bool enable) void gui_list_set_title(struct gui_list * gui_list, char * title) { gui_list->title = title; + if (title) { #ifdef HAVE_LCD_BITMAP - gui_list->display->getstringsize(title, &gui_list->title_width, NULL); + gui_list->display->getstringsize(title, &gui_list->title_width, NULL); #else - gui_list->title_width = strlen(title); + gui_list->title_width = strlen(title); #endif + } else { + gui_list->title_width = 0; + } } /* diff --git a/apps/tree.c b/apps/tree.c index 8de23bd..1bbb5f8 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -354,6 +354,9 @@ static int update_dir(void) } else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT) { gui_synclist_set_title(&tree_lists, tc.dirlevel > 0 ? strrchr(tc.currdir, '/') + 1 : "/"); + } else { + /* Must clear the title as the list is reused */ + gui_synclist_set_title(&tree_lists, NULL); } } gui_synclist_set_nb_items(&tree_lists, tc.filesindir); -- cgit v1.1