From d4914fc9ef4fda21f833e88a59d50d54fafd6379 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 5 Jul 2009 08:46:53 +0200 Subject: idle: added "update" event Some clients have visual feedback for "database update is running". Using the "database" idle event is unreliable, because it is only emitted when the database was actually modified. This patch adds the "update" event, which is emitted when the update is started, and again when the update is finished, disregarding whether it has been modified. --- src/update.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/update.c') diff --git a/src/update.c b/src/update.c index 1088f5338..d3e3b7650 100644 --- a/src/update.c +++ b/src/update.c @@ -822,6 +822,9 @@ directory_update_init(char *path) return next_task_id > update_task_id_max ? 1 : next_task_id; } spawn_update_task(path); + + idle_add(IDLE_UPDATE); + return update_task_id; } @@ -861,6 +864,8 @@ static void update_finished_event(void) g_thread_join(update_thr); + idle_add(IDLE_UPDATE); + if (modified) { /* send "idle" events */ playlistVersionChange(&g_playlist); -- cgit v1.2.3