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/gui | |
parent | a8f900384b8491c68fba3a31ad413492fd78eb6f (diff) | |
download | rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.tar.gz rockbox-923cbe322448ba6941ceb2165eae95dcd34bfd36.zip |
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/gui')
-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 9889a9f96c..cfaabafe90 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, | |||
767 | limit = *intval; | 767 | limit = *intval; |
768 | *intval = -1; | 768 | *intval = -1; |
769 | } | 769 | } |
770 | #if CONFIG_RTC | 770 | |
771 | int new_token = token->type; | ||
772 | if (token->type == WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED) | ||
773 | { | ||
774 | new_token = global_settings.timeformat == 0? | ||
775 | WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: | ||
776 | WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED; | ||
777 | } | ||
778 | else if (token->type == WPS_TOKEN_RTC_HOUR_CFG) | ||
779 | { | ||
780 | new_token = global_settings.timeformat == 0? | ||
781 | WPS_TOKEN_RTC_HOUR_24: | ||
782 | WPS_TOKEN_RTC_HOUR_12; | ||
783 | } | ||
784 | switch (new_token) | ||
785 | #else | ||
786 | switch (token->type) | 771 | switch (token->type) |
787 | #endif | ||
788 | { | 772 | { |
789 | case WPS_TOKEN_CHARACTER: | 773 | case WPS_TOKEN_CHARACTER: |
790 | return &(token->value.c); | 774 | return &(token->value.c); |
@@ -1110,7 +1094,11 @@ static char *get_token_value(struct gui_wps *gwps, | |||
1110 | *intval = global_settings.repeat_mode + 1; | 1094 | *intval = global_settings.repeat_mode + 1; |
1111 | snprintf(buf, buf_size, "%d", *intval); | 1095 | snprintf(buf, buf_size, "%d", *intval); |
1112 | return buf; | 1096 | return buf; |
1113 | 1097 | case WPS_TOKEN_RTC_12HOUR_CFG: | |
1098 | if (intval) | ||
1099 | *intval = global_settings.timeformat + 1; | ||
1100 | snprintf(buf, buf_size, "%d", *intval); | ||
1101 | return buf; | ||
1114 | #if CONFIG_RTC | 1102 | #if CONFIG_RTC |
1115 | case WPS_TOKEN_RTC_DAY_OF_MONTH: | 1103 | case WPS_TOKEN_RTC_DAY_OF_MONTH: |
1116 | /* d: day of month (01..31) */ | 1104 | /* d: day of month (01..31) */ |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 70a192ad1c..70f4c560c6 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -152,8 +152,7 @@ enum wps_token_type { | |||
152 | 152 | ||
153 | WPS_TOKEN_RTC_DAY_OF_MONTH, | 153 | WPS_TOKEN_RTC_DAY_OF_MONTH, |
154 | WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, | 154 | WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, |
155 | WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, | 155 | WPS_TOKEN_RTC_12HOUR_CFG, |
156 | WPS_TOKEN_RTC_HOUR_CFG, | ||
157 | WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, | 156 | WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, |
158 | WPS_TOKEN_RTC_HOUR_24, | 157 | WPS_TOKEN_RTC_HOUR_24, |
159 | WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, | 158 | WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 2b8975894c..960eab43da 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -166,8 +166,7 @@ static const struct wps_tag all_tags[] = { | |||
166 | 166 | ||
167 | { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, | 167 | { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, |
168 | { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL }, | 168 | { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL }, |
169 | { WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, "cf", WPS_RTC_REFRESH, NULL }, | 169 | { WPS_TOKEN_RTC_12HOUR_CFG, "cf", WPS_RTC_REFRESH, NULL }, |
170 | { WPS_TOKEN_RTC_HOUR_CFG, "cg", WPS_RTC_REFRESH, NULL }, | ||
171 | { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL }, | 170 | { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL }, |
172 | { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL }, | 171 | { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL }, |
173 | { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL }, | 172 | { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL }, |