From f54c588ec763d258ac5b4f6a784fa74be97c880f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 20:28:30 +0200 Subject: [PATCH] screen_browser: removed browser_playlist_changed() This function is unused, since we have switched to idle events. --- src/screen_browser.c | 56 -------------------------------------------- src/screen_browser.h | 4 ---- 2 files changed, 60 deletions(-) diff --git a/src/screen_browser.c b/src/screen_browser.c index bce4083..c09497d 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -40,36 +40,6 @@ static const char playlist_format[] = "*%s*"; #ifndef NCMPC_MINI -/* clear the highlight flag for all items in the filelist */ -static void -clear_highlights(struct filelist *fl) -{ - guint i; - - for (i = 0; i < filelist_length(fl); ++i) { - struct filelist_entry *entry = filelist_get(fl, i); - - entry->flags &= ~HIGHLIGHT; - } -} - -/* change the highlight flag for a song */ -static void -set_highlight(struct filelist *fl, struct mpd_song *song, int highlight) -{ - int i = filelist_find_song(fl, song); - struct filelist_entry *entry; - - if (i < 0) - return; - - entry = filelist_get(fl, i); - if (highlight) - entry->flags |= HIGHLIGHT; - else - entry->flags &= ~HIGHLIGHT; -} - /* sync highlight flags with playlist */ void sync_highlights(struct mpdclient *c, struct filelist *fl) @@ -93,32 +63,6 @@ sync_highlights(struct mpdclient *c, struct filelist *fl) } } -/* the playlist has been updated -> fix highlights */ -void -browser_playlist_changed(struct screen_browser *browser, struct mpdclient *c, - int event, gpointer data) -{ - if (browser->filelist == NULL) - return; - - switch(event) { - case PLAYLIST_EVENT_CLEAR: - clear_highlights(browser->filelist); - break; - case PLAYLIST_EVENT_ADD: - set_highlight(browser->filelist, (struct mpd_song *) data, 1); - break; - case PLAYLIST_EVENT_DELETE: - set_highlight(browser->filelist, (struct mpd_song *) data, 0); - break; - case PLAYLIST_EVENT_MOVE: - break; - default: - sync_highlights(c, browser->filelist); - break; - } -} - #endif /* list_window callback */ diff --git a/src/screen_browser.h b/src/screen_browser.h index 44d1d66..54e94de 100644 --- a/src/screen_browser.h +++ b/src/screen_browser.h @@ -41,10 +41,6 @@ struct screen_browser { void sync_highlights(struct mpdclient *c, struct filelist *fl); -void -browser_playlist_changed(struct screen_browser *browser, struct mpdclient *c, - int event, gpointer data); - #endif const char *browser_lw_callback(unsigned index, bool *highlight, char** second_column, void *filelist); -- 2.30.2