summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 96c04bde89..4ddf1d2d2d 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -3673,7 +3673,8 @@ static bool load_tagcache(void)
3673# endif 3673# endif
3674 { 3674 {
3675 3675
3676# if 0 /* Maybe we could enable this for flash players. Too slow otherwise. */ 3676 /* Enabled for flash based targets. Too slow otherwise. */
3677# ifdef HAVE_FLASH_STORAGE
3677 /* Check if entry has been removed. */ 3678 /* Check if entry has been removed. */
3678 if (global_settings.tagcache_autoupdate) 3679 if (global_settings.tagcache_autoupdate)
3679 { 3680 {
@@ -3834,11 +3835,20 @@ static bool check_dir(const char *dirname)
3834 if (entry->attribute & ATTR_DIRECTORY) 3835 if (entry->attribute & ATTR_DIRECTORY)
3835 check_dir(curpath); 3836 check_dir(curpath);
3836 else 3837 else
3838 {
3839 tc_stat.curentry = curpath;
3837#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 3840#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
3838 add_tagcache(curpath, dir->internal_entry); 3841 add_tagcache(curpath, dir->internal_entry);
3839#else 3842#else
3840 add_tagcache(curpath); 3843 add_tagcache(curpath);
3841#endif 3844#endif
3845
3846 /* Wait until current path for debug screen is read and unset. */
3847 while (tc_stat.syncscreen && tc_stat.curentry != NULL)
3848 yield();
3849
3850 tc_stat.curentry = NULL;
3851 }
3842 3852
3843 curpath[len] = '\0'; 3853 curpath[len] = '\0';
3844 } 3854 }
@@ -3848,6 +3858,16 @@ static bool check_dir(const char *dirname)
3848 return success; 3858 return success;
3849} 3859}
3850 3860
3861void tagcache_screensync_event(void)
3862{
3863 tc_stat.curentry = NULL;
3864}
3865
3866void tagcache_screensync_enable(bool state)
3867{
3868 tc_stat.syncscreen = state;
3869}
3870
3851void build_tagcache(const char *path) 3871void build_tagcache(const char *path)
3852{ 3872{
3853 struct tagcache_header header; 3873 struct tagcache_header header;
@@ -4046,10 +4066,15 @@ static void tagcache_thread(void)
4046 if (global_settings.tagcache_autoupdate) 4066 if (global_settings.tagcache_autoupdate)
4047 { 4067 {
4048 build_tagcache("/"); 4068 build_tagcache("/");
4049 /* Don't do auto removal without dircache (very slow). */ 4069 /* Don't do auto removal without dircache or flash
4050#ifdef HAVE_DIRCACHE 4070 * storage (very slow). */
4071#ifdef HAVE_FLASH_STORAGE
4072 check_deleted_files();
4073#else
4074# ifdef HAVE_DIRCACHE
4051 if (dircache_is_enabled()) 4075 if (dircache_is_enabled())
4052 check_deleted_files(); 4076 check_deleted_files();
4077# endif
4053#endif 4078#endif
4054 } 4079 }
4055 4080