From: Max Kellermann Date: Sat, 10 Oct 2009 13:47:43 +0000 (+0200) Subject: mpdclient: set all idle events on disconnect X-Git-Tag: release-0.16~147 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9c8b5f9177ca2c374db1dbe0f3098a9c182a3492;p=ncmpc.git mpdclient: set all idle events on disconnect After a disconnect, all subsystems have to consider the "new data" (i.e. nothing). --- diff --git a/src/mpdclient.c b/src/mpdclient.c index a96dead..d000df1 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -134,6 +134,11 @@ mpdclient_disconnect(struct mpdclient *c) if (c->song) c->song = NULL; + + /* everything has changed after a disconnect */ + c->idle |= MPD_IDLE_DATABASE|MPD_IDLE_STORED_PLAYLIST| + MPD_IDLE_QUEUE|MPD_IDLE_PLAYER|MPD_IDLE_MIXER|MPD_IDLE_OUTPUT| + MPD_IDLE_OPTIONS|MPD_IDLE_UPDATE; } bool diff --git a/src/screen.c b/src/screen.c index c01c792..58cc492 100644 --- a/src/screen.c +++ b/src/screen.c @@ -426,7 +426,8 @@ screen_update(struct mpdclient *c) crossfade = mpd_status_get_crossfade(c->status); } - if ((c->events & MPD_IDLE_DATABASE) != 0 && was_connected) + if ((c->events & MPD_IDLE_DATABASE) != 0 && was_connected && + mpdclient_is_connected(c)) screen_status_printf(_("Database updated")); was_connected = mpdclient_is_connected(c);