diff options
author | Damon Chaplin <damon@ximian.com> | 2001-11-14 07:55:26 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-11-14 07:55:26 +0800 |
commit | 7c6861ba11143038d33d6c57a8890775020f4610 (patch) | |
tree | 2af5200a3f9dda48bae97a5aac1864299ed23b52 /calendar/gui/calendar-config.c | |
parent | 16cb05f315452b36990666ab57d22385ec098ff5 (diff) | |
download | gsoc2013-evolution-7c6861ba11143038d33d6c57a8890775020f4610.tar.gz gsoc2013-evolution-7c6861ba11143038d33d6c57a8890775020f4610.tar.zst gsoc2013-evolution-7c6861ba11143038d33d6c57a8890775020f4610.zip |
make the timezone default to UTC. Fixes bug #14362.
2001-11-13 Damon Chaplin <damon@ximian.com>
* gui/alarm-notify/config-data.c (ensure_inited):
* gui/calendar-config.c (config_read):
* conduits/todo/todo-conduit.c (get_default_timezone):
* conduits/calendar/calendar-conduit.c (get_default_timezone):
make the timezone default to UTC. Fixes bug #14362.
svn path=/trunk/; revision=14691
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r-- | calendar/gui/calendar-config.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 419f4cedb5..b5ae415faf 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -148,15 +148,13 @@ config_read (void) CORBA_exception_free (&ev); - CORBA_exception_init (&ev); - config->timezone = bonobo_config_get_string (db, - "/Calendar/Display/Timezone", &ev); - if (BONOBO_USER_EX (&ev, ex_Bonobo_ConfigDatabase_NotFound)) - config->timezone = NULL; - else if (BONOBO_EX (&ev)) - g_message ("config_read(): Could not get the /Calendar/Display/Timezone"); - - CORBA_exception_free (&ev); + /* Default to UTC if the timezone is not set or is "". */ + config->timezone = bonobo_config_get_string_with_default (db, + "/Calendar/Display/Timezone", "UTC", NULL); + if (!config->timezone || !config->timezone[0]) { + g_free (config->timezone); + config->timezone = g_strdup ("UTC"); + } config->working_days = bonobo_config_get_long_with_default (db, "/Calendar/Display/WorkingDays", CAL_MONDAY | CAL_TUESDAY | @@ -465,9 +463,8 @@ calendar_config_get_timezone (void) } -/* Sets the timezone. You shouldn't really set it to the empty string or NULL, - as this means that Evolution will show the timezone-setting dialog to ask - the user for the timezone. It copies the string. */ +/* Sets the timezone. If set to NULL it defaults to UTC. + FIXME: Should check it is being set to a valid timezone. */ void calendar_config_set_timezone (gchar *timezone) { @@ -476,7 +473,7 @@ calendar_config_set_timezone (gchar *timezone) if (timezone && timezone[0]) config->timezone = g_strdup (timezone); else - config->timezone = NULL; + config->timezone = g_strdup ("UTC"); } |