--- rockbox.orig/apps/onplay.c 2010-10-19 15:20:19.737836400 +0700 +++ rockbox/apps/onplay.c 2010-10-27 11:52:49.664226700 +0700 @@ -1055,6 +1055,18 @@ } MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_SET_AS_START_DIR), set_startdir, NULL, clipboard_callback, Icon_file_view_menu); +#ifdef HAVE_TAGCACHE +static bool set_start_tagcache(void) +{ + snprintf(global_settings.start_tagcache, + sizeof(global_settings.start_tagcache), + "%s/", selected_file); + settings_save(); + return false; +} +MENUITEM_FUNCTION(set_start_tagcache_item, 0, ID2P(LANG_SET_AS_START_TAGCACHE), + set_start_tagcache, NULL, clipboard_callback, Icon_NOICON); +#endif static int clipboard_callback(int action,const struct menu_item_ex *this_item) { @@ -1112,6 +1124,9 @@ #ifdef HAVE_RECORDING || this_item == &set_recdir_item #endif +#ifdef HAVE_TAGCACHE + || this_item == &set_start_tagcache_item +#endif ) return action; } @@ -1174,6 +1189,9 @@ &set_recdir_item, #endif &set_startdir_item, &add_to_faves_item, +#ifdef HAVE_TAGCACHE + &set_start_tagcache_item, +#endif ); static int onplaymenu_callback(int action,const struct menu_item_ex *this_item) { --- rockbox.orig/apps/settings.h 2010-10-19 15:20:19.796839700 +0700 +++ rockbox/apps/settings.h 2010-10-27 11:52:10.994014900 +0700 @@ -576,6 +576,7 @@ #endif bool tagcache_autoupdate; /* automatically keep tagcache in sync? */ bool runtimedb; /* runtime database active? */ + char start_tagcache[2*MAX_FILENAME+1]; #endif /* HAVE_TAGCACHE */ #if LCD_DEPTH > 1 --- rockbox.orig/apps/settings_list.c 2010-10-19 15:20:20.138859300 +0700 +++ rockbox/apps/settings_list.c 2010-10-27 11:57:34.064493500 +0700 @@ -1247,6 +1247,11 @@ #ifdef HAVE_TAGCACHE OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false, "gather runtime data", NULL), +#if (CONFIG_PLATFORM & PLATFORM_ANDROID) + TEXT_SETTING(0, start_tagcache, "start tagcache", "/sdcard", NULL, NULL), +#else + TEXT_SETTING(0, start_tagcache, "start tagcache", "/", NULL, NULL), +#endif #endif #if CONFIG_CODEC == SWCODEC --- rockbox.orig/apps/tagcache.c 2010-10-19 15:20:20.230864600 +0700 +++ rockbox/apps/tagcache.c 2010-10-27 11:57:07.224958300 +0700 @@ -4462,11 +4462,11 @@ remove_files(); remove(get_user_file_path(TAGCACHE_FILE_TEMP, IS_FILE|NEED_WRITE, path, sizeof(path))); - tagcache_build("/"); + tagcache_build(global_settings.start_tagcache); break; case Q_UPDATE: - tagcache_build("/"); + tagcache_build(global_settings.start_tagcache); #ifdef HAVE_TC_RAMCACHE load_ramcache(); #endif @@ -4484,13 +4484,13 @@ { load_ramcache(); if (tc_stat.ramcache && global_settings.tagcache_autoupdate) - tagcache_build("/"); + tagcache_build(global_settings.start_tagcache); } else #endif if (global_settings.tagcache_autoupdate) { - tagcache_build("/"); + tagcache_build(global_settings.start_tagcache); /* This will be very slow unless dircache is enabled or target is flash based, but do it anyway for --- rockbox.orig/apps/lang/english.lang 2010-10-25 09:47:38.787087500 +0700 +++ rockbox/apps/lang/english.lang 2010-10-27 08:14:42.847703600 +0700 @@ -2428,6 +2428,34 @@ + id: LANG_SET_AS_START_TAGCACHE + desc: used in the onplay menu to set tagcache start directory + user: core + + *: "Start Database Update Here" + + + *: "Start Database Update Here" + + + *: none + + + + id: LANG_RESET_START_TAGCACHE + desc: reset the tagcache start directory + user: core + + *: "Reset Database Root Directory" + + + *: "Reset Database Root Directory" + + + *: none + + + id: LANG_TAGCACHE_FORCE_UPDATE_SPLASH desc: in tag cache settings user: core --- rockbox.orig/apps/menus/settings_menu.c 2010-10-19 15:14:42.081523500 +0700 +++ rockbox/apps/menus/settings_menu.c 2010-10-27 11:55:45.909307300 +0700 @@ -80,12 +80,26 @@ MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT), (int(*)(void))tagtree_import, NULL, NULL, Icon_NOICON); +static int clear_start_tagcache(void) +{ +#if (CONFIG_PLATFORM & PLATFORM_ANDROID) + strcpy(global_settings.start_tagcache, "/sdcard"); +#else + strcpy(global_settings.start_tagcache, "/"); +#endif + settings_save(); + splash(HZ, ID2P(LANG_RESET_DONE_CLEAR)); + return false; +} +MENUITEM_FUNCTION(clear_start_tagcache_item, 0, ID2P(LANG_RESET_START_TAGCACHE), + clear_start_tagcache, NULL, NULL, Icon_NOICON); MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON, #ifdef HAVE_TC_RAMCACHE &tagcache_ram, #endif &tagcache_autoupdate, &tc_init, &tc_update, &runtimedb, - &tc_export, &tc_import); + &tc_export, &tc_import, &clear_start_tagcache_item + ); #endif /* HAVE_TAGCACHE */ /* TAGCACHE MENU */ /***********************************/