diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tagtree.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index 2694a764a0..d354d7c2a1 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -2039,10 +2039,9 @@ int tagtree_get_filename(struct tree_context* c, char *buf, int buflen) | |||
2039 | static bool insert_all_playlist(struct tree_context *c, int position, bool queue) | 2039 | static bool insert_all_playlist(struct tree_context *c, int position, bool queue) |
2040 | { | 2040 | { |
2041 | struct tagcache_search tcs; | 2041 | struct tagcache_search tcs; |
2042 | int i; | 2042 | int i, n; |
2043 | unsigned long last_tick; | ||
2043 | char buf[MAX_PATH]; | 2044 | char buf[MAX_PATH]; |
2044 | int from, to, direction; | ||
2045 | int files_left = c->filesindir; | ||
2046 | 2045 | ||
2047 | cpu_boost(true); | 2046 | cpu_boost(true); |
2048 | if (!tagcache_search(&tcs, tag_filename)) | 2047 | if (!tagcache_search(&tcs, tag_filename)) |
@@ -2063,15 +2062,21 @@ static bool insert_all_playlist(struct tree_context *c, int position, bool queue | |||
2063 | } | 2062 | } |
2064 | } | 2063 | } |
2065 | 2064 | ||
2066 | from = 0; | 2065 | last_tick = current_tick + HZ/2; /* Show splash after 0.5 seconds have passed */ |
2067 | to = c->filesindir; | ||
2068 | direction = 1; | ||
2069 | 2066 | ||
2070 | for (i = from; i != to; i += direction) | 2067 | n = c->filesindir; |
2068 | for (i = 0; i < n; i++) | ||
2071 | { | 2069 | { |
2072 | /* Count back to zero */ | 2070 | if (TIME_AFTER(current_tick, last_tick - 1)) |
2073 | if (!show_search_progress(false, files_left--)) | 2071 | { |
2074 | break; | 2072 | splash_progress(i, n, "%s (%s)", str(LANG_WAIT), str(LANG_OFF_ABORT)); |
2073 | if (TIME_AFTER(current_tick, last_tick + HZ/10)) | ||
2074 | { | ||
2075 | if (action_userabort(TIMEOUT_NOBLOCK)) | ||
2076 | break; | ||
2077 | last_tick = current_tick; | ||
2078 | } | ||
2079 | } | ||
2075 | 2080 | ||
2076 | if (!tagcache_retrieve(&tcs, tagtree_get_entry(c, i)->extraseek, | 2081 | if (!tagcache_retrieve(&tcs, tagtree_get_entry(c, i)->extraseek, |
2077 | tcs.type, buf, sizeof buf)) | 2082 | tcs.type, buf, sizeof buf)) |