Code

screen: check if song and lyrics screens are enabled
authorMax Kellermann <max@duempel.org>
Wed, 25 Mar 2009 06:49:59 +0000 (07:49 +0100)
committerMax Kellermann <max@duempel.org>
Wed, 25 Mar 2009 06:49:59 +0000 (07:49 +0100)
The patch "screen swap works with song/lyrics screens" broke the
build, because it didn't check whether the song screen and the lyrics
screen were enabled.

src/screen.c

index 622582582a60edb1872fb8b33b1b252048ace8fb..85f1250ae31ed258831fc356f58d9912d2c9a87d 100644 (file)
@@ -96,10 +96,16 @@ screen_swap(struct mpdclient *c, const struct mpd_song *song)
 {
        if (song != NULL)
        {
+               if (false)
+                       { /* just a hack to make the ifdefs less ugly */ }
+#ifdef ENABLE_SONG_SCREEN
                if (mode_fn_prev == &screen_song)
                        screen_song_switch(c, song);
+#endif
+#ifdef ENABLE_LYRICS_SCREEN
                else if (mode_fn_prev == &screen_lyrics)
                        screen_lyrics_switch(c, song);
+#endif
                else
                        screen_switch(mode_fn_prev, c);
        }