aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_artist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-19 16:23:31 +0200
committerMax Kellermann <max@duempel.org>2008-09-19 16:23:31 +0200
commitd1c31cf66398447b5ba0d0a60de5b92ad162675c (patch)
tree3e8b8868d7078e70408a96a9795acd9b19d7008c /src/screen_artist.c
parente3b42caa5d39d084ba511aee43fada91e367ae3e (diff)
downloadmpd-d1c31cf66398447b5ba0d0a60de5b92ad162675c.tar.gz
mpd-d1c31cf66398447b5ba0d0a60de5b92ad162675c.tar.xz
mpd-d1c31cf66398447b5ba0d0a60de5b92ad162675c.zip
filelist: provide more functions for working with a filelist
Avoid direct accesses to the filelist struct, provide an API for that.
Diffstat (limited to 'src/screen_artist.c')
-rw-r--r--src/screen_artist.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 61f05cc51..71be6f408 100644
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
@@ -108,8 +108,6 @@ update_metalist(mpdclient_t *c, char *m_artist, char *m_album)
if (m_album) {
/* retreive songs... */
- filelist_entry_t *entry;
-
artist = m_artist;
album = m_album;
if (album[0] == 0) {
@@ -124,11 +122,8 @@ update_metalist(mpdclient_t *c, char *m_artist, char *m_album)
MPD_TABLE_ALBUM,
album);
/* add a dummy entry for ".." */
- entry = g_malloc0(sizeof(filelist_entry_t));
- entry->entity = NULL;
- browser.filelist->list = g_list_insert(browser.filelist->list,
- entry, 0);
- browser.filelist->length++;
+ filelist_prepend(browser.filelist, NULL);
+
/* install playlist callback and fix highlights */
sync_highlights(c, browser.filelist);
mpdclient_install_playlist_callback(c, playlist_changed_callback);
@@ -425,7 +420,7 @@ artist_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
case CMD_LIST_RFIND_NEXT:
if (browser.filelist)
return screen_find(screen,
- browser.lw, browser.filelist->length,
+ browser.lw, filelist_length(browser.filelist),
cmd, browser_lw_callback,
browser.filelist);
else if (metalist)
@@ -443,7 +438,7 @@ artist_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
}
if (browser.filelist)
- return list_window_cmd(browser.lw, browser.filelist->length, cmd);
+ return list_window_cmd(browser.lw, filelist_length(browser.filelist), cmd);
else if (metalist)
return list_window_cmd(browser.lw, metalist_length, cmd);