summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8e36c5)
raw | patch | inline | side by side (parent: e8e36c5)
author | Max Kellermann <max@duempel.org> | |
Tue, 25 Nov 2008 20:11:23 +0000 (21:11 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 25 Nov 2008 20:11:23 +0000 (21:11 +0100) |
The scrolling code broke in the ncmpc-mini build. Disable it when
--enable-mini was specified.
--enable-mini was specified.
src/screen_play.c | patch | blob | history | |
src/support.c | patch | blob | history | |
src/support.h | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index b4fb15f574eb9f5679db3c3cd216e5f41c1052b6..525207618e7c3a976b388f27c080bbe0f8bd7175 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
list_callback(unsigned idx, int *highlight, G_GNUC_UNUSED void *data)
{
static char songname[MAX_SONG_LENGTH];
+#ifndef NCMPC_MINI
static scroll_state_t st;
+#endif
mpd_Song *song;
if (playlist == NULL || idx >= playlist_length(playlist))
strfsong(songname, MAX_SONG_LENGTH, options.list_format, song);
+#ifndef NCMPC_MINI
if (options.scroll && (unsigned)song->pos == lw->selected &&
utf8_width(songname) > (unsigned)COLS) {
static unsigned current_song;
g_free(tmp);
} else if ((unsigned)song->pos == lw->selected)
st.offset = 0;
+#endif
return songname;
}
current_song_id = c->song != NULL && c->status != NULL &&
!IS_STOPPED(c->status->state) ? c->song->id : -1;
- if (options.scroll || current_song_id != prev_song_id) {
+ if (current_song_id != prev_song_id
+#ifndef NCMPC_MINI
+ || options.scroll
+#endif
+ ) {
prev_song_id = current_song_id;
/* center the cursor */
diff --git a/src/support.c b/src/support.c
index 8d9d0d01079fa61b8069d14f9f074911f1ebccc3..68dc558873cff4830e0ffabd9e7cb827864bdf72 100644 (file)
--- a/src/support.c
+++ b/src/support.c
}
#endif /* HAVE_STRCASESTR */
+#ifndef NCMPC_MINI
+
// FIXME: utf-8 length
char *
strscroll(char *str, char *separator, int width, scroll_state_t *st)
g_free(tmp);
return buf;
}
+
+#endif
diff --git a/src/support.h b/src/support.h
index 95bde46913338d65f307a810b6409b584af90cc3..f7c08325d4e10234aec1139db7566d825cb84acf 100644 (file)
--- a/src/support.h
+++ b/src/support.h
#ifndef SUPPORT_H
#define SUPPORT_H
+#include "config.h"
+
#include <glib.h>
const char *strcasestr(const char *haystack, const char *needle);
+#ifndef NCMPC_MINI
+
typedef struct {
gsize offset;
GTime t; /* GTime is equivalent to time_t */
char *strscroll(char *str, char *separator, int width, scroll_state_t *st);
#endif
+
+#endif