Code

screen_song: make Path a proper label
[ncmpc.git] / src / main.c
index 1b351c705b68ede3eb4bc71baa3e10f43e9a5c93..1e7caeea8444a346c003466851c80ab3f254c5fa 100644 (file)
@@ -271,7 +271,12 @@ default_settings_name(void)
 
        return name;
 #else
-       return g_strdup(options.host);
+       /*
+        * localhost is actually not correct, we only know that
+        * mpd_connection_new() has connected to the "default host".
+        */
+       const char *name = options.host ?: "localhost";
+       return g_strdup(name);
 #endif
 }
 
@@ -288,12 +293,7 @@ connection_settings_name(const struct mpd_connection *connection)
 #else
        (void)connection;
 
-       /*
-        * localhost is actually not correct, we only know that
-        * mpd_connection_new() has connected to the "default host".
-        */
-       const char *name = options.host ?: "localhost";
-       return g_strdup(name);
+       return default_settings_name();
 #endif
 }
 
@@ -360,9 +360,7 @@ timer_reconnect(G_GNUC_UNUSED gpointer data)
        doupdate();
 
        /* update immediately */
-       mpd->events = 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;
+       mpd->events = MPD_IDLE_ALL;
 
        do_mpd_update();
 
@@ -393,7 +391,7 @@ idle_callback(enum mpd_error error, enum mpd_server_error server_error,
 
        c->idle = false;
 
-       assert(mpdclient_get_connection(c) != NULL);
+       assert(mpdclient_is_connected(c));
 
        if (error != MPD_ERROR_SUCCESS) {
                char *allocated;