mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
Sometimes we need to know when the progress bar should disappear. Checking curr >= total wasn't enough since there're cases not met that condition for the last call. So add a new ->finish callback to identify this explicitly. Currently only GTK frontend needs it. Signed-off-by: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
27 lines
530 B
C
27 lines
530 B
C
#include "../cache.h"
|
|
#include "progress.h"
|
|
|
|
static void nop_progress_update(u64 curr __maybe_unused,
|
|
u64 total __maybe_unused,
|
|
const char *title __maybe_unused)
|
|
{
|
|
}
|
|
|
|
static struct ui_progress default_progress_fns =
|
|
{
|
|
.update = nop_progress_update,
|
|
};
|
|
|
|
struct ui_progress *progress_fns = &default_progress_fns;
|
|
|
|
void ui_progress__update(u64 curr, u64 total, const char *title)
|
|
{
|
|
return progress_fns->update(curr, total, title);
|
|
}
|
|
|
|
void ui_progress__finish(void)
|
|
{
|
|
if (progress_fns->finish)
|
|
progress_fns->finish();
|
|
}
|