Code

screen: simplified CMD_SCREEN_UPDATE handlers
authorMax Kellermann <max@duempel.org>
Mon, 22 Sep 2008 08:21:34 +0000 (10:21 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 22 Sep 2008 08:21:34 +0000 (10:21 +0200)
Since screen.c has default code for CMD_SCREEN_UPDATE, return 0 from
the command handlers and let screen.c do the rest.

src/screen_artist.c
src/screen_file.c
src/screen_play.c

index de0466c652065193992655d28d0075e9a29e7d35..dd7e0175a180e0f6eb8d4d3bb796bab9d2100990 100644 (file)
@@ -417,8 +417,6 @@ artist_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
 
                /* continue and update... */
        case CMD_SCREEN_UPDATE:
-               screen->painted = 0;
-               browser.lw->clear = 1;
                update_metalist(c, g_strdup(artist), g_strdup(album));
                screen_status_printf(_("Screen updated!"));
                return 0;
index 083b5e34738fb5f2610d1d2d30710e2cb01bf635..9205250048d79f3591f0d16b9e901b56626c511e 100644 (file)
@@ -224,13 +224,12 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                handle_save(screen, c);
                break;
        case CMD_SCREEN_UPDATE:
-               screen->painted = 0;
-               browser.lw->clear = 1;
                browser.filelist = mpdclient_filelist_update(c, browser.filelist);
                list_window_check_selected(browser.lw,
                                           filelist_length(browser.filelist));
                screen_status_printf(_("Screen updated!"));
-               return 1;
+               return 0;
+
        case CMD_DB_UPDATE:
                if (c->status == NULL)
                        return 1;
index bea8e1253e840e52db628027b582451ee64e6554..625e953d43b4fb6ceed78bd1e606fd47b7a98135 100644 (file)
@@ -471,10 +471,9 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                handle_add_to_playlist(screen, c);
                return 1;
        case CMD_SCREEN_UPDATE:
-               screen->painted = 0;
-               lw->clear = 1;
                center_playing_item(c);
-               return 1;
+               return 0;
+
        case CMD_LIST_MOVE_UP:
                mpdclient_cmd_move(c, lw->selected, lw->selected-1);
                return 1;