From f7ba156b27e661bf4f6cdba9d961640e6a3e5c1d Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 17 Feb 2010 07:17:06 +0000 Subject: change the %St tag so it only shows the filename of file settings, not the full path (i.e cabbiev2 instead of /.rockbox/wps/cabbiev2.wps) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24717 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index fa80e86ab6..105a6789ee 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -901,10 +901,10 @@ const char *get_token_value(struct gui_wps *gwps, case WPS_TOKEN_SETTING: { + const struct settings_list *s = settings+token->value.i; if (intval) { /* Handle contionals */ - const struct settings_list *s = settings+token->value.i; switch (s->flags&F_T_MASK) { case F_T_INT: @@ -930,6 +930,7 @@ const char *get_token_value(struct gui_wps *gwps, *intval = *(bool*)s->setting?1:2; break; case F_T_CHARPTR: + case F_T_UCHARPTR: /* %?St|name| * The string's emptyness discards the setting's * prefix and suffix */ @@ -941,6 +942,13 @@ const char *get_token_value(struct gui_wps *gwps, break; } } + /* Special handlng for filenames because we dont want to show the prefix */ + if ((s->flags&F_T_MASK) == F_T_UCHARPTR || + (s->flags&F_T_MASK) == F_T_UCHARPTR) + { + if (s->filename_setting->prefix) + return (char*)s->setting; + } cfg_to_string(token->value.i,buf,buf_size); return buf; } -- cgit v1.2.3