From: Max Kellermann Date: Fri, 12 Jun 2009 17:40:08 +0000 (+0200) Subject: mpdclient: tweak updatingdb in mpdclient.c X-Git-Tag: release-0.15~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=266baf83ad8f6929b59e080dfbcdc392c2f33663;p=ncmpc.git mpdclient: tweak updatingdb in mpdclient.c The mpdclient library should care about setting the new (temporary) MPD update status. --- diff --git a/src/mpdclient.c b/src/mpdclient.c index 9aab2fc..cc391ab 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -412,8 +412,18 @@ mpdclient_cmd_crossfade(mpdclient_t *c, gint value) gint mpdclient_cmd_db_update(mpdclient_t *c, gchar *path) { + gint ret; + mpd_sendUpdateCommand(c->connection, path ? path : ""); - return mpdclient_finish_command(c); + ret = mpdclient_finish_command(c); + + if (ret == 0) + /* set updatingDb to make sure the browse callback + gets called even if the update has finished before + status is updated */ + c->status->updatingDb = 1; + + return ret; } gint diff --git a/src/screen_file.c b/src/screen_file.c index fdb8a5a..a149e91 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -272,10 +272,6 @@ browse_cmd(mpdclient_t *c, command_t cmd) g_free(path_locale); } else screen_status_printf(_("Database update started")); - - /* set updatingDb to make sure the browse callback gets called - * even if the updated has finished before status is updated */ - c->status->updatingDb = 1; } } else screen_status_printf(_("Database update running..."));