1
0
Fork 0
forked from len0rd/rockbox

Fix displaying of the database browser's progress splash so that it works as intended (according to r16432: hide until 0.5s have passed, but never if the disk isn't spinning).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22442 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-08-20 19:31:09 +00:00
parent c9d0961138
commit 16983afae7

View file

@ -954,7 +954,7 @@ static bool show_search_progress(bool init, int count)
} }
/* Update progress every 1/10 of a second */ /* Update progress every 1/10 of a second */
if (current_tick - last_tick > HZ/10) if (TIME_AFTER(current_tick, last_tick + HZ/10))
{ {
splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), count, str(LANG_OFF_ABORT)); splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), count, str(LANG_OFF_ABORT));
if (action_userabort(TIMEOUT_NOBLOCK)) if (action_userabort(TIMEOUT_NOBLOCK))
@ -1061,23 +1061,15 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
int sort_limit; int sort_limit;
int strip; int strip;
if (init && (tagcache_is_busy() /* Show search progress straight away if the disk needs to spin up,
#ifdef HAVE_TC_RAMCACHE otherwise show it after the normal 1/2 second delay */
|| !tagcache_is_ramcache() show_search_progress(
#endif
) )
{
/* Show search progress straight away if the disk needs to spin up,
otherwise show it after the normal 1/2 second delay */
show_search_progress(
!tagcache_is_busy() &&
#ifdef HAVE_DISK_STORAGE #ifdef HAVE_DISK_STORAGE
storage_disk_is_active() storage_disk_is_active()
#else #else
true true
#endif #endif
, 0); , 0);
}
if (c->currtable == ALLSUBENTRIES) if (c->currtable == ALLSUBENTRIES)
{ {
@ -1249,7 +1241,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
if (init && !tcs.ramsearch) if (init && !tcs.ramsearch)
{ {
if (!show_search_progress(false, total_count)) if (!show_search_progress(false, total_count))
{ { /* user aborted */
tagcache_search_finish(&tcs); tagcache_search_finish(&tcs);
return current_entry_count; return current_entry_count;
} }
@ -1304,6 +1296,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
} }
return total_count; return total_count;
} }
static int load_root(struct tree_context *c) static int load_root(struct tree_context *c)
@ -1647,9 +1640,16 @@ bool tagtree_insert_selection_playlist(int position, bool queue)
char buf[MAX_PATH]; char buf[MAX_PATH];
int dirlevel = tc->dirlevel; int dirlevel = tc->dirlevel;
/* We need to set the table to allsubentries. */ show_search_progress(
show_search_progress(!tagcache_is_busy(), 0); #ifdef HAVE_DISK_STORAGE
storage_disk_is_active()
#else
true
#endif
, 0);
/* We need to set the table to allsubentries. */
dptr = tagtree_get_entry(tc, tc->selected_item); dptr = tagtree_get_entry(tc, tc->selected_item);
/* Insert a single track? */ /* Insert a single track? */