1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jonathan Gordon 2010-02-17 07:17:06 +00:00
parent eb943e9495
commit f7ba156b27

View file

@ -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|<if non empty string|if empty>
* 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;
}