/**
* @brief Gets timezone from vconf.
*
- * @return timezone id or "N/A" on failure
+ * @param[in/out] timezone id or "N/A" on failure
*/
-extern char *util_get_timezone_str(void);
+extern void util_get_timezone_str(char **timezone);
/**
* @brief Gets window angle property.
retm_if(ret != SYSTEM_SETTINGS_ERROR_NONE, "Error getting time format value");
/* Check Time format. If timeformat have invalid value, Set to 12H */
- if (mode_24)
- {
- if(clock_mode == INDICATOR_CLOCK_MODE_12H)
- {
+ if (mode_24) {
+ if(clock_mode == INDICATOR_CLOCK_MODE_12H) {
clock_mode = INDICATOR_CLOCK_MODE_24H;
box_update_display(&(ad->win));
}
}
- else
- {
- if(clock_mode==INDICATOR_CLOCK_MODE_24H)
- {
+ else {
+ if(clock_mode == INDICATOR_CLOCK_MODE_24H) {
clock_mode = INDICATOR_CLOCK_MODE_12H;
box_update_display(&(ad->win));
}
}
- char *timezone_str = util_get_timezone_str();
+ char *timezone_str = NULL;
+ util_get_timezone_str(&timezone_str);
+ ret_if(!timezone_str);
ret = i18n_timezone_create(&timezone, timezone_str);
if (ret != I18N_ERROR_NONE) {
i18n_ustring_copy_au(s_best_pattern, u_best_pattern);
i18n_ustring_copy_ua(u_best_pattern, "a");
- char *timezone_id = util_get_timezone_str();
+ char *timezone_id = NULL;
+ util_get_timezone_str(&timezone_id);
_D("TimeZone is %s", timezone_id);
if (s_best_pattern[0] == 'a') {
return;
}
- char* timezone_id = util_get_timezone_str();
+ char *timezone_id = NULL;
+ util_get_timezone_str(&timezone_id);
+
_D("TimeZone is %s", timezone_id);
if (timezone_id) {
-static char* _get_timezone_from_vconf(void)
+void util_get_timezone_str(char **timezone)
{
- char *szTimezone = NULL;
- szTimezone = vconf_get_str(VCONFKEY_SETAPPL_TIMEZONE_ID);
- if(szTimezone == NULL)
- {
- _E("Cannot get time zone.");
- return strdup("N/A");
+ int ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, timezone);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ _E("system_settings_get_value_string failed: %s", get_error_message(ret));
+ *timezone = "N/A";
}
-
- return szTimezone;
-}
-
-
-
-char* util_get_timezone_str(void)
-{
- return _get_timezone_from_vconf();
}