summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-24 09:18:03 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-24 09:18:03 +0000
commitdda102ed4aae4bf32108ae9751c01d6883a6ae2c (patch)
tree2c867144b8fadb7ff8b45ff9f7b6537139ec502c
parentba46c88c6f077f7e6e1c266e9742870802037b68 (diff)
downloadrockbox-dda102ed4aae4bf32108ae9751c01d6883a6ae2c.tar.gz
rockbox-dda102ed4aae4bf32108ae9751c01d6883a6ae2c.tar.bz2
rockbox-dda102ed4aae4bf32108ae9751c01d6883a6ae2c.zip
fix the %Ti (preset index) not working with conditionls correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26246 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_tokens.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 594614aab1..7997290119 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -417,11 +417,9 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
case WPS_TOKEN_TUNER_CURFREQ:
return format_freq_MHz(radio_current_frequency(),
region_data->freq_step, buf, buf_size);
- case WPS_TOKEN_PRESET_ID:
- snprintf(buf, buf_size, "%d", radio_current_preset() + 1 + preset_offset);
- return buf;
case WPS_TOKEN_PRESET_NAME:
case WPS_TOKEN_PRESET_FREQ:
+ case WPS_TOKEN_PRESET_ID:
{
int preset_count = radio_preset_count();
int cur_preset = radio_current_preset();
@@ -434,9 +432,11 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
preset += preset_count;
if (token->type == WPS_TOKEN_PRESET_NAME)
snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name);
- else
+ else if (token->type == WPS_TOKEN_PRESET_FREQ)
format_freq_MHz(radio_get_preset(preset)->frequency,
region_data->freq_step, buf, buf_size);
+ else
+ snprintf(buf, buf_size, "%d", preset + 1);
return buf;
}
case WPS_TOKEN_PRESET_COUNT: