diff options
author | Milan Crha <mcrha@redhat.com> | 2008-01-25 22:10:07 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-01-25 22:10:07 +0800 |
commit | 34da45d5d6f03a24f32edf8a41a783ad489f9296 (patch) | |
tree | e8c479e2cd57bc82eae49205ef9accb0d953a479 /calendar/gui | |
parent | c4046c56365033ebc17c21f4bda6411ffe5bf1fc (diff) | |
download | gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.gz gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.bz2 gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.lz gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.xz gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.zst gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.zip |
** Fix for bug #475781
2008-01-25 Milan Crha <mcrha@redhat.com>
** Fix for bug #475781
* plugins/save-calendar/csv-format.c: (do_save_calendar_csv):
* plugins/save-calendar/rdf-format.c: (do_save_calendar_rdf):
* plugins/itip-formatter/itip-formatter.c: (format_itip_object):
* calendar/gui/dialogs/recurrence-page.c: (fill_ending_date),
(recurrence_page_fill_widgets):
* calendar/gui/dialogs/memo-page.c: (memo_page_fill_widgets):
* calendar/gui/e-day-view.c: 2*(e_day_view_finish_long_event_resize),
2*(e_day_view_on_editing_stopped):
* calendar/gui/itip-utils.c: (comp_compliant), (reply_to_calendar_comp):
* calendar/gui/e-week-view.c: (e_week_view_on_editing_stopped):
* calendar/gui/e-calendar-view.c: (e_calendar_view_add_event),
(e_calendar_view_get_tooltips):
* calendar/gui/e-cal-component-preview.c: (write_html):
* calendar/gui/e-cal-component-memo-preview.c: (write_html):
* calendar/gui/e-cal-model.c: (add_instance_cb):
Fix memory leaks around ECalComponentDateTime.
svn path=/trunk/; revision=34895
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-component-memo-preview.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-cal-component-preview.c | 6 | ||||
-rw-r--r-- | calendar/gui/e-cal-model.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 8 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 86 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 16 | ||||
-rw-r--r-- | calendar/gui/itip-utils.c | 2 |
9 files changed, 90 insertions, 36 deletions
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 038346c898..cbb4d2b0cd 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -413,6 +413,7 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) start_tt->day); } else if (!(page->flags & COMP_EDITOR_PAGE_NEW_ITEM)) e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); + e_cal_component_free_datetime (&d); /* Classification. */ e_cal_component_get_classification (comp, &cl); diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 485ac95ec0..34e748a7d7 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -1528,6 +1528,8 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) r->until.second = 0; r->until.is_date = TRUE; r->until.is_utc = FALSE; + + e_cal_component_free_datetime (&dt); } priv->ending_date_tt = r->until; @@ -1774,6 +1776,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) e_cal_component_get_dtstart (comp, &dt); priv->month_index = dt.value->day; priv->month_num = MONTH_NUM_LAST; + e_cal_component_free_datetime (&dt); } else { priv->month_index = nth; priv->month_num = MONTH_NUM_DAY; diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c index 87bfa265d9..dd5131eb92 100644 --- a/calendar/gui/e-cal-component-memo-preview.c +++ b/calendar/gui/e-cal-component-memo-preview.c @@ -211,9 +211,9 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>", _("Start Date:"), str); - e_cal_component_free_datetime (&dt); g_free (str); } + e_cal_component_free_datetime (&dt); /* write description and URL */ gtk_html_stream_printf (stream, "<TR><TD COLSPAN=\"2\"><HR></TD></TR>"); diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index be3bfa1bdf..a73c10ef66 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -199,9 +199,9 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>", _("Start Date:"), str); - e_cal_component_free_datetime (&dt); g_free (str); } + e_cal_component_free_datetime (&dt); /* write end date */ e_cal_component_get_dtend (comp, &dt); @@ -210,9 +210,9 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>", _("Start Date:"), str); - e_cal_component_free_datetime (&dt); g_free (str); } + e_cal_component_free_datetime (&dt); /* write Due Date */ e_cal_component_get_due (comp, &dt); @@ -221,9 +221,9 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>", _("Due Date:"), str); - e_cal_component_free_datetime (&dt); g_free (str); } + e_cal_component_free_datetime (&dt); /* write status */ gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Status:")); diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 344540193e..9f2f3c4ada 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -1347,6 +1347,7 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end to_set.value = &time; to_set.tzid = datetime.tzid; e_cal_component_set_dtstart (comp, &to_set); + e_cal_component_free_datetime (&datetime); /* set the right instance end date to component*/ e_cal_component_get_dtend (comp, &datetime); @@ -1355,6 +1356,7 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end to_set.value = &time; to_set.tzid = datetime.tzid; e_cal_component_set_dtend (comp, &to_set); + e_cal_component_free_datetime (&datetime); comp_data = g_new0 (ECalModelComponent, 1); comp_data->client = g_object_ref (rdata->client); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 7246ea1534..9f01ffa0b6 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -363,13 +363,16 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart g_free (uid); /* set the timezone properly */ - dt.value = &itime; e_cal_component_get_dtstart (comp, &dt); dt.tzid = icaltimezone_get_tzid (default_zone); e_cal_component_set_dtstart (comp, &dt); + e_cal_component_free_datetime (&dt); + e_cal_component_get_dtend (comp, &dt); dt.tzid = icaltimezone_get_tzid (default_zone); e_cal_component_set_dtend (comp, &dt); + e_cal_component_free_datetime (&dt); + e_cal_component_commit_sequence (comp); /* FIXME Error handling */ @@ -2246,6 +2249,9 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) tmp1 = get_label(dtstart.value, zone, default_zone); tmp = calculate_time (t_start, t_end); + e_cal_component_free_datetime (&dtstart); + e_cal_component_free_datetime (&dtend); + /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/ tmp2 = g_strdup_printf(_("Time: %s %s"), tmp1, tmp); hbox = gtk_hbox_new (FALSE, 0); diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 9e90ed1ea1..29468c30c8 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4969,23 +4969,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view) date.tzid = NULL; if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) { - e_cal_component_get_dtstart (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtstart (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_start_row]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } else { - e_cal_component_get_dtend (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtend (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_end_row + 1]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } e_cal_component_commit_sequence (comp); @@ -5209,23 +5217,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view) date.tzid = NULL; if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) { - e_cal_component_get_dtstart (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtstart (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_start_row]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } else { + ECalComponentDateTime ecdt; + e_cal_component_get_dtend (comp, &date); - is_date = date.value->is_date; + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_end_row + 1]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } e_cal_component_commit_sequence (comp); @@ -7733,35 +7749,41 @@ e_day_view_on_editing_stopped (EDayView *day_view, } if (mod == CALOBJ_MOD_THIS) { - ECalComponentDateTime dt; + ECalComponentDateTime olddt, dt; - e_cal_component_get_dtstart (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtstart (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtstart (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); - e_cal_component_get_dtend (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtend (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtend (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); @@ -7890,35 +7912,41 @@ e_day_view_on_editing_stopped (EDayView *day_view, } if (mod == CALOBJ_MOD_THIS) { - ECalComponentDateTime dt; + ECalComponentDateTime olddt, dt; - e_cal_component_get_dtstart (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtstart (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtstart (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); - e_cal_component_get_dtend (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtend (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtend (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index f638fb9a91..cca54b0d22 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -3532,20 +3532,27 @@ e_week_view_on_editing_stopped (EWeekView *week_view, if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime dt; + struct icaltimetype tt; + char *tzid; e_cal_component_get_dtstart (comp, &dt); if (dt.value->zone) { - *dt.value = icaltime_from_timet_with_zone ( + tt = icaltime_from_timet_with_zone ( event->comp_data->instance_start, dt.value->is_date, dt.value->zone); } else { - *dt.value = icaltime_from_timet_with_zone ( + tt = icaltime_from_timet_with_zone ( event->comp_data->instance_start, dt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); } + tzid = g_strdup (dt.tzid); + e_cal_component_free_datetime (&dt); + dt.value = &tt; + dt.tzid = tzid; e_cal_component_set_dtstart (comp, &dt); + g_free (tzid); e_cal_component_get_dtend (comp, &dt); if (dt.value->zone) { @@ -3559,7 +3566,12 @@ e_week_view_on_editing_stopped (EWeekView *week_view, dt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); } + tzid = g_strdup (dt.tzid); + e_cal_component_free_datetime (&dt); + dt.value = &tt; + dt.tzid = tzid; e_cal_component_set_dtend (comp, &dt); + g_free (tzid); e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index beeec18e4b..3022b4f6aa 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -1109,6 +1109,7 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien icaltimezone_convert_time (&r->until, from_zone, to_zone); r->until.is_utc = TRUE; + e_cal_component_free_datetime (&dt); e_cal_component_set_rrule_list (clone, rrule_list); e_cal_component_abort_sequence (clone); } @@ -1515,6 +1516,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp time = g_strdup (ctime (&start)); } + e_cal_component_free_datetime (&dtstart); body = g_string_new ("<br><br><hr><br><b>______ Original Appointment ______ </b><br><br><table>"); |