summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 117f606)
raw | patch | inline | side by side (parent: 117f606)
author | Thomas Jansen <mithi@mithi.net> | |
Wed, 28 Oct 2009 11:17:04 +0000 (12:17 +0100) | ||
committer | Thomas Jansen <mithi@mithi.net> | |
Wed, 28 Oct 2009 11:17:04 +0000 (12:17 +0100) |
This improves readability, as no #ifdefs are required in the *.c files around
the screen_browser_sync_highlights calls anymore.
the screen_browser_sync_highlights calls anymore.
src/screen_artist.c | patch | blob | history | |
src/screen_browser.h | patch | blob | history | |
src/screen_file.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 892587bcf03ee25f32c3d4fe736e5e76ae1bd474..9bd1b3e0df6a7b85c1359adb05dd31c7002e8430 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
mpdclient_handle_error(c);
}
-#ifndef NCMPC_MINI
/* fix highlights */
screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
list_window_set_length(browser.lw, filelist_length(browser.filelist));
}
/* the db has changed -> update the list */
reload_lists(c);
-#ifndef NCMPC_MINI
if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_PLAYLIST))
screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
if (c->events & (MPD_IDLE_DATABASE
#ifndef NCMPC_MINI
diff --git a/src/screen_browser.h b/src/screen_browser.h
index c3a47de16b0a9c7ba0888556c6c0613c8ad20f9d..8589e75f6855ee502d7f6185b0a2c76ab2220560 100644 (file)
--- a/src/screen_browser.h
+++ b/src/screen_browser.h
screen_browser_sync_highlights(struct filelist *fl,
const struct mpdclient_playlist *playlist);
+#else
+
+#include <glib.h>
+static inline void
+screen_browser_sync_highlights(G_GNUC_UNUSED struct filelist *fl,
+ G_GNUC_UNUSED const struct mpdclient_playlist *playlist)
+{
+}
+
#endif
void
diff --git a/src/screen_file.c b/src/screen_file.c
index 86df8c7c0dae30bb9a97f3e163bb927df6310a1a..25a86d1bb8f0c0ca8d75f5746818fe361b9d8d4a 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
screen_file_reload(c);
-#ifndef NCMPC_MINI
screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
list_window_reset(browser.lw);
screen_file_open(struct mpdclient *c)
{
screen_file_reload(c);
-#ifndef NCMPC_MINI
screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
}
static const char *
screen_file_reload(c);
}
-#ifndef NCMPC_MINI
- if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_STORED_PLAYLIST |
- MPD_IDLE_PLAYLIST))
- screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
-
if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_STORED_PLAYLIST
#ifndef NCMPC_MINI
| MPD_IDLE_PLAYLIST
#endif
- ))
+ )) {
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
screen_file_repaint();
+ }
}
static bool
case CMD_SCREEN_UPDATE:
screen_file_reload(c);
-#ifndef NCMPC_MINI
screen_browser_sync_highlights(browser.filelist, &c->playlist);
-#endif
screen_file_repaint();
return false;