diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-27 01:41:59 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-27 01:41:59 +0000 |
| commit | 923cbe322448ba6941ceb2165eae95dcd34bfd36 (patch) | |
| tree | 0d245f9d965ab506c8726fe8980502a5cf47f110 /apps | |
| parent | a8f900384b8491c68fba3a31ad413492fd78eb6f (diff) | |
| download | rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.zip rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.tar.gz rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.tar.bz2 rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.tar.xz | |
revert my previous commit and use a conditional for the time format instead which is probably better.
%?cf<24 hour stuff|12 hour stuff>
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15830 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/gui/gwps-common.c | 24 | ||||
| -rw-r--r-- | apps/gui/gwps.h | 3 | ||||
| -rw-r--r-- | apps/gui/wps_parser.c | 3 |
3 files changed, 8 insertions, 22 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 9889a9f..cfaabaf 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -767,24 +767,8 @@ static char *get_token_value(struct gui_wps *gwps, limit = *intval; *intval = -1; } -#if CONFIG_RTC - int new_token = token->type; - if (token->type == WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED) - { - new_token = global_settings.timeformat == 0? - WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: - WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED; - } - else if (token->type == WPS_TOKEN_RTC_HOUR_CFG) - { - new_token = global_settings.timeformat == 0? - WPS_TOKEN_RTC_HOUR_24: - WPS_TOKEN_RTC_HOUR_12; - } - switch (new_token) -#else + switch (token->type) -#endif { case WPS_TOKEN_CHARACTER: return &(token->value.c); @@ -1110,7 +1094,11 @@ static char *get_token_value(struct gui_wps *gwps, *intval = global_settings.repeat_mode + 1; snprintf(buf, buf_size, "%d", *intval); return buf; - + case WPS_TOKEN_RTC_12HOUR_CFG: + if (intval) + *intval = global_settings.timeformat + 1; + snprintf(buf, buf_size, "%d", *intval); + return buf; #if CONFIG_RTC case WPS_TOKEN_RTC_DAY_OF_MONTH: /* d: day of month (01..31) */ diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 70a192a..70f4c56 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h @@ -152,8 +152,7 @@ enum wps_token_type { WPS_TOKEN_RTC_DAY_OF_MONTH, WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, - WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, - WPS_TOKEN_RTC_HOUR_CFG, + WPS_TOKEN_RTC_12HOUR_CFG, WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, WPS_TOKEN_RTC_HOUR_24, WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 2b89758..960eab4 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c @@ -166,8 +166,7 @@ static const struct wps_tag all_tags[] = { { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL }, - { WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, "cf", WPS_RTC_REFRESH, NULL }, - { WPS_TOKEN_RTC_HOUR_CFG, "cg", WPS_RTC_REFRESH, NULL }, + { WPS_TOKEN_RTC_12HOUR_CFG, "cf", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL }, |