Code

screen_browser: removed browser_playlist_changed()
authorMax Kellermann <max@duempel.org>
Wed, 30 Sep 2009 18:28:30 +0000 (20:28 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 30 Sep 2009 18:28:30 +0000 (20:28 +0200)
This function is unused, since we have switched to idle events.

src/screen_browser.c
src/screen_browser.h

index bce4083af5aab1bde60396e9ca920db953737146..c09497d0eac874588fb28059eec8cb2c2ef12173 100644 (file)
@@ -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 */
index 44d1d66b71b6434f0b13543fa490bc455952aeb4..54e94de86ace670ea6fe92386e644492dc1dbb1f 100644 (file)
@@ -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);