aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-29 14:56:37 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-29 15:03:00 +0100
commit5939c7135a7f6d7d3aaed6923317108b70c0d118 (patch)
tree9149c3962eb1f26c66bfd2e5142ce4a18cca3cd5
parentae67595c3ee852978c182685aec7eaf1c9c087a7 (diff)
downloadnncmpp-5939c7135a7f6d7d3aaed6923317108b70c0d118.tar.gz
nncmpp-5939c7135a7f6d7d3aaed6923317108b70c0d118.tar.xz
nncmpp-5939c7135a7f6d7d3aaed6923317108b70c0d118.zip
Handle disconnects better
Reset all state and update the UI.
-rw-r--r--nncmpp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 4433bf1..1e6d2b4 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -2743,11 +2743,15 @@ mpd_on_failure (void *user_data)
{
(void) user_data;
// This is also triggered both by a failed connect and a clean disconnect
- print_error ("connection to MPD failed");
+ print_debug ("connection to MPD failed");
mpd_queue_reconnect ();
- // TODO: reset all state related to the connection and update the UI:
- // str_map_free(&g_ctx.playback_info), mpd_update_playback_state()?
+ item_list_resize (&g_ctx.playlist, 0);
+ str_map_free (&g_ctx.playback_info);
+ mpd_update_playback_state ();
+
+ current_tab_update ();
+ info_tab_update ();
}
static void