From: Max Kellermann Date: Sat, 10 Oct 2009 13:58:06 +0000 (+0200) Subject: screen_search: moved help text into a global variable X-Git-Tag: release-0.16~145 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc2f58b12e1170f1b1f52d64f2c06c1172112949;p=ncmpc.git screen_search: moved help text into a global variable --- diff --git a/src/screen_search.c b/src/screen_search.c index b410219..b2b6b11 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -94,33 +94,27 @@ static gboolean advanced_search_mode = FALSE; static struct screen_browser browser; +static const char *const help_text[] = { + "Quick - Enter a string and ncmpc will search according", + " to the current search mode (displayed above).", + "", + "Advanced - : [:...]", + " Example: artist:radiohead album:pablo honey", + "", + " Available tags: artist, album, title, track,", + " name, genre, date composer, performer, comment, file", + "", +}; /* search info */ static const char * lw_search_help_callback(unsigned idx, G_GNUC_UNUSED bool *highlight, G_GNUC_UNUSED char** sc, G_GNUC_UNUSED void *data) { - unsigned text_rows; - static const char *text[] = { - "Quick - Enter a string and ncmpc will search according", - " to the current search mode (displayed above).", - "", - "Advanced - : [:...]", - " Example: artist:radiohead album:pablo honey", - "", - " Available tags: artist, album, title, track,", - " name, genre, date composer, performer, comment, file", - "", - NULL - }; - - text_rows=0; - while (text[text_rows]) - text_rows++; - - if (idx < text_rows) - return text[idx]; - return NULL; + if (idx >= G_N_ELEMENTS(help_text)) + return NULL; + + return help_text[idx]; } static void