summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4464a84)
raw | patch | inline | side by side (parent: 4464a84)
author | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 20:02:35 +0000 (22:02 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 20:02:35 +0000 (22:02 +0200) |
And add the screen_browser_ prefix to the function name.
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 905566d4849d1368a4df97a63ff537df49e911ff..d3c182233c9c0ef95b67fb74981c5e25b5ba7d88 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
#ifndef NCMPC_MINI
/* fix highlights */
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
#endif
}
#ifndef NCMPC_MINI
if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_PLAYLIST))
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
#endif
if (c->events & (MPD_IDLE_DATABASE
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 7658cf3cc4f0d08308f0b9ef41648378f1311d94..3c94746cacd738b9b4cf1a6fc3179460199438e2 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
/* sync highlight flags with playlist */
void
-sync_highlights(struct mpdclient *c, struct filelist *fl)
+screen_browser_sync_highlights(struct filelist *fl,
+ const struct mpdclient_playlist *playlist)
{
guint i;
const struct mpd_song *song =
mpd_entity_get_song(entity);
- if (playlist_get_index_from_same_song(&c->playlist,
+ if (playlist_get_index_from_same_song(playlist,
song) >= 0)
entry->flags |= HIGHLIGHT;
else
diff --git a/src/screen_browser.h b/src/screen_browser.h
index 54e94de86ace670ea6fe92386e644492dc1dbb1f..57a575bca2d192ae671c8b33ef2720f1aa8938e8 100644 (file)
--- a/src/screen_browser.h
+++ b/src/screen_browser.h
#include <stdbool.h>
struct mpdclient;
+struct mpdclient_playlist;
struct filelist;
struct list_window;
struct list_window_state;
#ifndef NCMPC_MINI
void
-sync_highlights(struct mpdclient *c, struct filelist *fl);
+screen_browser_sync_highlights(struct filelist *fl,
+ const struct mpdclient_playlist *playlist);
#endif
diff --git a/src/screen_file.c b/src/screen_file.c
index 3aaade12a03896d727d92e34cbc8062c40dc7f6f..53997a5ed8109196827f163a8f3efe560627361d 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
screen_file_reload(c);
#ifndef NCMPC_MINI
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
#endif
list_window_reset(browser.lw);
#ifndef NCMPC_MINI
if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_STORED_PLAYLIST |
MPD_IDLE_PLAYLIST))
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
#endif
if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_STORED_PLAYLIST
case CMD_SCREEN_UPDATE:
screen_file_reload(c);
#ifndef NCMPC_MINI
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
#endif
list_window_check_selected(browser.lw,
filelist_length(browser.filelist));
diff --git a/src/screen_search.c b/src/screen_search.c
index 43f6ea9e23b1daa22e9b889cc1a856c13255bfed..66b05b54b6b8e94b48df4a9894c17536a011598d 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
if (browser.filelist == NULL)
browser.filelist = filelist_new();
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
list_window_check_selected(browser.lw, filelist_length(browser.filelist));
}
screen_search_update(struct mpdclient *c)
{
if (browser.filelist != NULL && c->events & MPD_IDLE_PLAYLIST) {
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
search_repaint();
}
}
FALSE,
mode[options.search_mode].table,
pattern);
- sync_highlights(c, browser.filelist);
+ screen_browser_sync_highlights(browser.filelist,
+ &c->playlist);
}
search_repaint();
return true;