aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-02-06 11:03:46 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-02-06 11:03:46 +0800
commit9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd (patch)
treeea90ec6bdbaa2642c2112096c01cc892c08cd006 /calendar
parentf50cbd6b5ec4ab3616e693e83ececd617f559521 (diff)
downloadgsoc2013-evolution-9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd.tar.gz
gsoc2013-evolution-9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd.tar.zst
gsoc2013-evolution-9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd.zip
Convert the calendar_config_get_timezone and
2004-02-05 JP Rosevear <jpr@ximian.com> * Convert the calendar_config_get_timezone and icaltimezone_get_builtin_timezone pair to just calendar_config_get_icaltimezone, this also guarantees we will have some timezone (even if its just UTC) svn path=/trunk/; revision=24642
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/comp-editor-factory.c10
-rw-r--r--calendar/gui/comp-util.c5
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c4
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c4
-rw-r--r--calendar/gui/dialogs/event-page.c11
-rw-r--r--calendar/gui/dialogs/recurrence-page.c2
-rw-r--r--calendar/gui/dialogs/task-details-page.c7
-rw-r--r--calendar/gui/dialogs/task-page.c8
-rw-r--r--calendar/gui/e-alarm-list.c4
-rw-r--r--calendar/gui/e-cal-list-view-config.c9
-rw-r--r--calendar/gui/e-cal-view.c6
-rw-r--r--calendar/gui/e-calendar-table-config.c9
-rw-r--r--calendar/gui/e-calendar-table.c4
-rw-r--r--calendar/gui/e-calendar-view.c6
-rw-r--r--calendar/gui/e-cell-date-edit-config.c8
-rw-r--r--calendar/gui/e-day-view-config.c9
-rw-r--r--calendar/gui/e-day-view.c10
-rw-r--r--calendar/gui/e-itip-control.c3
-rw-r--r--calendar/gui/e-meeting-store.c2
-rw-r--r--calendar/gui/e-tasks.c15
-rw-r--r--calendar/gui/e-week-view-config.c9
-rw-r--r--calendar/gui/gnome-cal.c8
-rw-r--r--calendar/gui/goto.c4
-rw-r--r--calendar/gui/itip-utils.c2
-rw-r--r--calendar/gui/print.c41
-rw-r--r--calendar/gui/tag-calendar.c4
27 files changed, 58 insertions, 153 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 16f208d7b9..fdeb173ac3 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,12 @@
2004-02-05 JP Rosevear <jpr@ximian.com>
+ * Convert the calendar_config_get_timezone and
+ icaltimezone_get_builtin_timezone pair to just
+ calendar_config_get_icaltimezone, this guarantees we will have
+ some timezone
+
+2004-02-05 JP Rosevear <jpr@ximian.com>
+
* gui/calendar-config.h: add proto
* gui/calendar-config.c (calendar_config_get_icaltimezone): return
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index e3904bbbf2..3763bbdb87 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -345,7 +345,6 @@ resolve_pending_requests (OpenClient *oc)
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
GSList *l;
- char *location;
icaltimezone *zone;
factory = oc->factory;
@@ -355,11 +354,10 @@ resolve_pending_requests (OpenClient *oc)
return;
/* Set the default timezone in the backend. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (zone)
- /* FIXME Error handling? */
- e_cal_set_default_timezone (oc->client, zone, NULL);
+ zone = calendar_config_get_icaltimezone ();
+
+ /* FIXME Error handling? */
+ e_cal_set_default_timezone (oc->client, zone, NULL);
for (l = oc->pending; l; l = l->next) {
Request *request;
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index f08bd100b2..efe9c99aa1 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -322,16 +322,13 @@ cal_comp_event_new_with_current_time (ECal *client, gboolean all_day)
ECalComponent *comp;
struct icaltimetype itt;
ECalComponentDateTime dt;
- char *location;
icaltimezone *zone;
comp = cal_comp_event_new_with_defaults (client);
g_return_val_if_fail (comp, NULL);
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
+ zone = calendar_config_get_icaltimezone ();
if (all_day) {
itt = icaltime_from_timet_with_zone (time (NULL), 1, zone);
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index a821bdc70f..69fadbd136 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -868,13 +868,11 @@ show_config (DialogData *dialog_data)
{
CalWeekdays working_days;
gint mask, day, week_start_day, time_divisions;
- char *zone_name;
icaltimezone *zone;
gboolean sensitive;
/* Timezone. */
- zone_name = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (zone_name);
+ zone = calendar_config_get_icaltimezone ();
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (dialog_data->timezone),
zone);
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index bdb66c6c92..2383f760e0 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -254,14 +254,12 @@ comp_editor_new_date_edit (gboolean show_date, gboolean show_time,
struct tm
comp_editor_get_current_time (GtkObject *object, gpointer data)
{
- char *location;
icaltimezone *zone;
struct icaltimetype tt;
struct tm tmp_tm = { 0 };
/* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 5b04b9694a..cffa9f2e9a 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -324,11 +324,8 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD
/* If it is an all day event, we set both timezones to the current
timezone, so that if the user toggles the 'All Day Event' checkbox
the event uses the current timezone rather than none at all. */
- if (all_day_event) {
- char *location = calendar_config_get_timezone ();
- start_zone = end_zone = icaltimezone_get_builtin_timezone (location);
- }
-
+ if (all_day_event)
+ start_zone = end_zone = calendar_config_get_icaltimezone ();
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
@@ -1241,7 +1238,6 @@ init_widgets (EventPage *epage)
{
EventPagePrivate *priv;
GtkTextBuffer *text_buffer;
- char *location;
icaltimezone *zone;
priv = epage->priv;
@@ -1327,8 +1323,7 @@ init_widgets (EventPage *epage)
G_CALLBACK (source_changed_cb), epage);
/* Set the default timezone, so the timezone entry may be hidden. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->end_timezone), zone);
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index cdc820e6d6..aa42fca322 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -1453,7 +1453,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
e_cal_component_get_dtstart (priv->comp, &dt);
if (dt.value->is_date)
- to_zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
+ to_zone = calendar_config_get_icaltimezone ();
else if (dt.tzid == NULL)
to_zone = icaltimezone_get_utc_timezone ();
else
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 5d75c9b39a..729275a4ef 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -327,13 +327,11 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
e_cal_component_get_completed (comp, &completed);
if (completed) {
icaltimezone *utc_zone, *zone;
- char *location;
/* Completed is in UTC, but that would confuse the user, so
we convert it to local time. */
utc_zone = icaltimezone_get_utc_timezone ();
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
icaltimezone_convert_time (completed, utc_zone, zone);
@@ -419,8 +417,7 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp)
entire time the dialog is shown. Otherwise if the user
changes the timezone, the COMPLETED date may get changed
as well. */
- char *location = calendar_config_get_timezone ();
- icaltimezone *zone = icaltimezone_get_builtin_timezone (location);
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
icaltimezone_convert_time (&icaltime, zone,
icaltimezone_get_utc_timezone ());
e_cal_component_set_completed (comp, &icaltime);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 33fce5a6c1..e42b1fdd42 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -260,7 +260,6 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
GSList *l;
const char *categories;
icaltimezone *zone, *default_zone;
- char *location;
ESource *source;
tpage = TASK_PAGE (page);
@@ -286,8 +285,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
}
e_cal_component_free_text_list (l);
- location = calendar_config_get_timezone ();
- default_zone = icaltimezone_get_builtin_timezone (location);
+ default_zone = calendar_config_get_icaltimezone ();
/* Due Date. */
e_cal_component_get_due (comp, &d);
@@ -823,7 +821,6 @@ init_widgets (TaskPage *tpage)
{
TaskPagePrivate *priv;
GtkTextBuffer *text_buffer;
- char *location;
icaltimezone *zone;
priv = tpage->priv;
@@ -889,8 +886,7 @@ init_widgets (TaskPage *tpage)
G_CALLBACK (source_changed_cb), tpage);
/* Set the default timezone, so the timezone entry may be hidden. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->due_timezone), zone);
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
index 2c3a24525e..c8b968600f 100644
--- a/calendar/gui/e-alarm-list.c
+++ b/calendar/gui/e-alarm-list.c
@@ -518,7 +518,6 @@ get_alarm_string (ECalComponentAlarm *alarm)
case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: {
struct icaltimetype itt;
icaltimezone *utc_zone, *current_zone;
- char *location;
struct tm tm;
char buf[256];
@@ -527,8 +526,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
itt = trigger.u.abs_time;
utc_zone = icaltimezone_get_utc_timezone ();
- location = calendar_config_get_timezone ();
- current_zone = icaltimezone_get_builtin_timezone (location);
+ current_zone = calendar_config_get_icaltimezone ();
tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
diff --git a/calendar/gui/e-cal-list-view-config.c b/calendar/gui/e-cal-list-view-config.c
index e7d82230df..72c97455c6 100644
--- a/calendar/gui/e-cal-list-view-config.c
+++ b/calendar/gui/e-cal-list-view-config.c
@@ -159,17 +159,10 @@ e_cal_list_view_config_get_view (ECalListViewConfig *view_config)
static void
set_timezone (ECalListView *list_view)
{
- char *location;
icaltimezone *zone;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
+ zone = calendar_config_get_icaltimezone ();
e_calendar_view_set_timezone (E_CALENDAR_VIEW (list_view), zone);
-
- g_free (location);
}
static void
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
index 100d9dcc0b..cdbcae7289 100644
--- a/calendar/gui/e-cal-view.c
+++ b/calendar/gui/e-cal-view.c
@@ -756,7 +756,6 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
static void
clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView *cal_view)
{
- char *default_tzid;
icalcomponent *icalcomp;
icalcomponent_kind kind;
time_t selected_time_start, selected_time_end;
@@ -769,11 +768,8 @@ clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView
if (!icalcomp)
return;
- default_tzid = calendar_config_get_timezone ();
-
+ default_zone = calendar_config_get_icaltimezone ();
client = e_cal_model_get_default_client (cal_view->priv->model);
- /* FIXME Error checking */
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
/* check the type of the component */
/* FIXME An error dialog if we return? */
diff --git a/calendar/gui/e-calendar-table-config.c b/calendar/gui/e-calendar-table-config.c
index 74be72143f..25dd3d825d 100644
--- a/calendar/gui/e-calendar-table-config.c
+++ b/calendar/gui/e-calendar-table-config.c
@@ -162,19 +162,12 @@ static void
set_timezone (ECalendarTable *table)
{
ECalModel *model;
- char *location;
icaltimezone *zone;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
+ zone = calendar_config_get_icaltimezone ();
model = e_calendar_table_get_model (table);
if (model)
e_cal_model_set_timezone (model, zone);
-
- g_free (location);
}
static void
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 72e3311a4f..a659057559 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -1340,14 +1340,12 @@ e_calendar_table_save_state (ECalendarTable *cal_table,
static struct tm
e_calendar_table_get_current_time (ECellDateEdit *ecde, gpointer data)
{
- char *location;
icaltimezone *zone;
struct tm tmp_tm = { 0 };
struct icaltimetype tt;
/* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 100d9dcc0b..cdbcae7289 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -756,7 +756,6 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
static void
clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView *cal_view)
{
- char *default_tzid;
icalcomponent *icalcomp;
icalcomponent_kind kind;
time_t selected_time_start, selected_time_end;
@@ -769,11 +768,8 @@ clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView
if (!icalcomp)
return;
- default_tzid = calendar_config_get_timezone ();
-
+ default_zone = calendar_config_get_icaltimezone ();
client = e_cal_model_get_default_client (cal_view->priv->model);
- /* FIXME Error checking */
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
/* check the type of the component */
/* FIXME An error dialog if we return? */
diff --git a/calendar/gui/e-cell-date-edit-config.c b/calendar/gui/e-cell-date-edit-config.c
index 8993e53d68..a8c607a43c 100644
--- a/calendar/gui/e-cell-date-edit-config.c
+++ b/calendar/gui/e-cell-date-edit-config.c
@@ -163,19 +163,13 @@ set_timezone (ECellDateEdit *cell)
{
ECellDateEditText *cell_text;
ECellPopup *cell_popup;
- char *location;
icaltimezone *zone;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
+ zone = calendar_config_get_icaltimezone ();
cell_popup = E_CELL_POPUP (cell);
cell_text = E_CELL_DATE_EDIT_TEXT (cell_popup->child);
e_cell_date_edit_text_set_timezone (cell_text, zone);
-
- g_free (location);
}
static void
diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c
index 4c10451f40..4b53f1a350 100644
--- a/calendar/gui/e-day-view-config.c
+++ b/calendar/gui/e-day-view-config.c
@@ -159,17 +159,10 @@ e_day_view_config_get_view (EDayViewConfig *view_config)
static void
set_timezone (EDayView *day_view)
{
- char *location;
icaltimezone *zone;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
+ zone = calendar_config_get_icaltimezone ();
e_calendar_view_set_timezone (E_CALENDAR_VIEW (day_view), zone);
-
- g_free (location);
}
static void
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index e1f7179973..3ee3813f47 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -7005,7 +7005,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
&& !drag_from_same_window) {
/* We are dragging between different window */
- char *comp_str, *default_tzid;
+ char *comp_str;
icalcomponent *icalcomp;
icalcomponent_kind kind;
time_t dtstart;
@@ -7022,8 +7022,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
if (!icalcomp)
goto error;
- default_tzid = calendar_config_get_timezone ();
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
+ default_zone = calendar_config_get_icaltimezone ();
/* check the type of the component */
kind = icalcomponent_isa (icalcomp);
@@ -7196,7 +7195,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
&& !drag_from_same_window) {
/* We are dragging between different window */
- char *comp_str, *default_tzid;
+ char *comp_str;
icalcomponent *icalcomp;
icalcomponent_kind kind;
time_t dtstart;
@@ -7213,8 +7212,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
if (!icalcomp)
goto error;
- default_tzid = calendar_config_get_timezone ();
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
+ default_zone = calendar_config_get_icaltimezone ();
/* check the type of the component */
kind = icalcomponent_isa (icalcomp);
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 0f5e7f29d8..bff068a5b8 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -498,8 +498,7 @@ write_label_piece (EItipControl *itip, ECalComponentDateTime *dt,
the COMPLETED property, which is always in UTC, and also because
Outlook sends simple events as UTC times. */
if (dt->value->is_utc) {
- char *location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
icaltimezone_convert_time (dt->value, icaltimezone_get_utc_timezone (), zone);
}
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index 93af7cc280..bd89a46f83 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -618,7 +618,7 @@ ems_init (EMeetingStore *store)
priv->attendees = g_ptr_array_new ();
- priv->zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
+ priv->zone = calendar_config_get_icaltimezone ();
priv->refresh_queue = g_ptr_array_new ();
priv->refresh_data = g_hash_table_new (g_direct_hash, g_direct_equal);
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index bd4162c617..7376e72cb3 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -131,11 +131,7 @@ write_html (GtkHTMLStream *stream, ECalComponent *comp)
g_return_if_fail (E_IS_CAL_COMPONENT (comp));
- str = calendar_config_get_timezone ();
- if (str && str[0]) {
- current_zone = icaltimezone_get_builtin_timezone (str);
- } else
- current_zone = icaltimezone_get_utc_timezone ();
+ current_zone = calendar_config_get_icaltimezone ();
/* write document header */
e_cal_component_get_summary (comp, &text);
@@ -439,19 +435,12 @@ static void
set_timezone (ETasks *tasks)
{
ETasksPrivate *priv;
- char *location;
icaltimezone *zone;
GList *l;
priv = tasks->priv;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
+ zone = calendar_config_get_icaltimezone ();
for (l = priv->clients_list; l != NULL; l = l->next) {
ECal *client = l->data;
diff --git a/calendar/gui/e-week-view-config.c b/calendar/gui/e-week-view-config.c
index 1257813062..21a1eca5c7 100644
--- a/calendar/gui/e-week-view-config.c
+++ b/calendar/gui/e-week-view-config.c
@@ -159,17 +159,10 @@ e_week_view_config_get_view (EWeekViewConfig *view_config)
static void
set_timezone (EWeekView *week_view)
{
- char *location;
icaltimezone *zone;
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
+ zone = calendar_config_get_icaltimezone ();
e_calendar_view_set_timezone (E_CALENDAR_VIEW (week_view), zone);
-
- g_free (location);
}
static void
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 3091545104..bd9d8aba4d 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -835,17 +835,11 @@ static void
set_timezone (GnomeCalendar *calendar)
{
GnomeCalendarPrivate *priv;
- char *location;
GList *l;
priv = calendar->priv;
- location = calendar_config_get_timezone ();
- priv->zone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- if (!priv->zone)
- priv->zone = icaltimezone_get_utc_timezone ();
+ priv->zone = calendar_config_get_icaltimezone ();
for (l = priv->clients_list; l != NULL; l = l->next) {
ECal *client = l->data;
diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c
index 66c6ecbad4..89d37455ca 100644
--- a/calendar/gui/goto.c
+++ b/calendar/gui/goto.c
@@ -106,14 +106,12 @@ ecal_event (ECalendarItem *calitem, gpointer user_data)
static struct tm
get_current_time (ECalendarItem *calitem, gpointer data)
{
- char *location;
icaltimezone *zone;
struct tm tmp_tm = { 0 };
struct icaltimetype tt;
/* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index b47232cc7f..9efd5debf3 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -749,7 +749,7 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien
e_cal_component_get_dtstart (clone, &dt);
if (dt.value->is_date) {
- from_zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
+ from_zone = calendar_config_get_icaltimezone ();
} else if (dt.tzid == NULL) {
from_zone = icaltimezone_get_utc_timezone ();
} else {
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 3c32ef1448..b29934c09f 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -174,17 +174,6 @@ struct einfo
static GnomePrintConfig *print_config = NULL;
-
-/* Convenience function to help the transition to timezone functions.
- It returns the current timezone. */
-static icaltimezone*
-get_timezone (void)
-{
- char *location = calendar_config_get_timezone ();
- return icaltimezone_get_builtin_timezone (location);
-}
-
-
/* Convenience function to help the transition to timezone functions.
It converts a time_t to a struct tm. */
static struct tm*
@@ -512,7 +501,7 @@ static char *days[] = {
static char *
format_date(time_t time, int flags, char *buffer, int bufflen)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
char fmt[64];
struct tm tm;
@@ -566,7 +555,7 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month,
int titleflags, time_t greystart, time_t greyend,
int bordertitle)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
ECal *client;
GnomeFont *font, *font_bold, *font_normal;
time_t now, next;
@@ -895,7 +884,7 @@ print_day_add_event (ECalModelComponent *comp_data,
GArray **events)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
EDayViewEvent event;
gint day, offset;
struct icaltimetype start_tt, end_tt;
@@ -1159,7 +1148,7 @@ static void
print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
EDayViewEvent *event;
GnomeFont *font;
time_t start, end;
@@ -1195,7 +1184,7 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
/* Also print events outside of work hours */
if (pdi.events[0]->len > 0) {
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
struct icaltimetype tt;
event = &g_array_index (pdi.events[0], EDayViewEvent, 0);
@@ -1475,7 +1464,7 @@ print_week_view_background (GnomePrintContext *pc, GnomeFont *font,
double left, double top,
double cell_width, double cell_height)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
int day, day_x, day_y, day_h;
double x1, x2, y1, y2, font_size, fillcolor;
struct tm tm;
@@ -1540,7 +1529,7 @@ print_week_summary_cb (ECalComponent *comp,
gpointer data)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
EWeekViewEvent event;
struct icaltimetype start_tt, end_tt;
ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data;
@@ -1585,7 +1574,7 @@ print_week_summary (GnomePrintContext *pc, GnomeCalendar *gcal,
int month, double font_size,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
EWeekViewEvent *event;
struct psinfo psi;
time_t day_start;
@@ -1686,7 +1675,7 @@ print_year_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom,
int morerows)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
double row_height, col_width, l, r, t, b;
time_t now;
int col, row, rows, cols;
@@ -1728,7 +1717,7 @@ static void
print_month_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
time_t date;
struct tm tm;
struct icaltimetype tt;
@@ -1905,7 +1894,7 @@ static const int print_view_map[] = {
static GtkWidget *
range_selector_new (GtkWidget *dialog, time_t at, int *view)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
GtkWidget *box;
GtkWidget *radio;
GSList *group;
@@ -1993,7 +1982,7 @@ static void
print_day_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
int i, days = 1;
double todo, header, l;
char buf[100];
@@ -2051,7 +2040,7 @@ static void
print_week_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
double header, l;
char buf[100];
time_t when;
@@ -2121,7 +2110,7 @@ static void
print_month_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
double left, double right, double top, double bottom)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
double header;
char buf[100];
@@ -2178,7 +2167,7 @@ print_year_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
static void
write_label_piece (time_t t, char *buffer, int size, char *stext, char *etext)
{
- icaltimezone *zone = get_timezone ();
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
struct tm *tmp_tm;
int len;
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index f22055b685..fa80dd2c39 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -49,7 +49,6 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c, icaltimezone *zone
gint end_year, end_month, end_day;
struct icaltimetype start_tt = icaltime_null_time ();
struct icaltimetype end_tt = icaltime_null_time ();
- char *location;
if (clear_first)
e_calendar_item_clear_marks (ecal->calitem);
@@ -75,8 +74,7 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c, icaltimezone *zone
if (zone) {
c->zone = zone;
} else {
- location = calendar_config_get_timezone ();
- c->zone = icaltimezone_get_builtin_timezone (location);
+ c->zone = calendar_config_get_icaltimezone ();
}
c->start_time = icaltime_as_timet_with_zone (start_tt, c->zone);