From 31283ca1beceb15145360674da4690081bd30d97 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Mon, 22 Sep 2008 10:21:34 +0200
Subject: screen: simplified CMD_SCREEN_UPDATE handlers

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 | 2 --
 src/screen_file.c   | 5 ++---
 src/screen_play.c   | 5 ++---
 3 files changed, 4 insertions(+), 8 deletions(-)

(limited to 'src')

diff --git a/src/screen_artist.c b/src/screen_artist.c
index de0466c65..dd7e0175a 100644
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
@@ -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;
diff --git a/src/screen_file.c b/src/screen_file.c
index 083b5e347..920525004 100644
--- a/src/screen_file.c
+++ b/src/screen_file.c
@@ -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;
diff --git a/src/screen_play.c b/src/screen_play.c
index bea8e1253..625e953d4 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -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;
-- 
cgit v1.2.3