summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-03-10 12:51:08 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-03-10 12:51:08 +0000
commitfd30be55454cfd88c1cbbecb30f1fb483e40f2da (patch)
tree37f2ba924ddd5b6a2b4daa2cd007c47053a074a7
parenta990ff2920884ba6810dd222fd99ca627fd0e5d6 (diff)
downloadrockbox-fd30be55454cfd88c1cbbecb30f1fb483e40f2da.tar.gz
rockbox-fd30be55454cfd88c1cbbecb30f1fb483e40f2da.zip
Fix the database browser not remembering its selected item
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12705 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/root_menu.c4
-rw-r--r--apps/tree.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 49c31cb512..050f5be3c6 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -84,7 +84,7 @@ static int browser(void* param)
84 static char last_folder[MAX_PATH] = "/"; 84 static char last_folder[MAX_PATH] = "/";
85 /* and stuff for the database browser */ 85 /* and stuff for the database browser */
86#ifdef HAVE_TAGCACHE 86#ifdef HAVE_TAGCACHE
87 static int last_db_dirlevel = 0; 87 static int last_db_dirlevel = 0, last_db_selection = 0;
88#endif 88#endif
89 89
90 switch ((intptr_t)param) 90 switch ((intptr_t)param)
@@ -166,6 +166,7 @@ static int browser(void* param)
166 return GO_TO_PREVIOUS; 166 return GO_TO_PREVIOUS;
167 filter = SHOW_ID3DB; 167 filter = SHOW_ID3DB;
168 tc->dirlevel = last_db_dirlevel; 168 tc->dirlevel = last_db_dirlevel;
169 tc->selected_item = last_db_selection;
169 break; 170 break;
170#endif 171#endif
171 case GO_TO_BROWSEPLUGINS: 172 case GO_TO_BROWSEPLUGINS:
@@ -182,6 +183,7 @@ static int browser(void* param)
182#ifdef HAVE_TAGCACHE 183#ifdef HAVE_TAGCACHE
183 case GO_TO_DBBROWSER: 184 case GO_TO_DBBROWSER:
184 last_db_dirlevel = tc->dirlevel; 185 last_db_dirlevel = tc->dirlevel;
186 last_db_selection = tc->selected_item;
185 break; 187 break;
186#endif 188#endif
187 } 189 }
diff --git a/apps/tree.c b/apps/tree.c
index e4237dc598..d58c05deb7 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -632,6 +632,7 @@ int dirbrowse()
632 if (returned_button == ACTION_STD_CANCEL) 632 if (returned_button == ACTION_STD_CANCEL)
633 button = ACTION_STD_CANCEL; 633 button = ACTION_STD_CANCEL;
634 634
635 tc.selected_item = gui_synclist_get_sel_pos(&tree_lists);
635 switch ( button ) { 636 switch ( button ) {
636 case ACTION_STD_OK: 637 case ACTION_STD_OK:
637 /* nothing to do if no files to display */ 638 /* nothing to do if no files to display */
@@ -933,7 +934,6 @@ int dirbrowse()
933 } 934 }
934 935
935 if(need_update) { 936 if(need_update) {
936 tc.selected_item = gui_synclist_get_sel_pos(&tree_lists);
937 need_update=false; 937 need_update=false;
938 if ( numentries > 0 ) { 938 if ( numentries > 0 ) {
939 /* Voice the file if changed */ 939 /* Voice the file if changed */