2008-02-25  Chenthill Palanisamy  <pchenthill@novell.com>

        Fixes #516498
        * gui/comp-util.c: (cal_comp_is_on_server):
        * gui/e-calendar-view.c: (e_calendar_view_cut_clipboard),
        (delete_event), (e_calendar_view_delete_selected_occurrence):
        * gui/e-day-view.c: (process_component):
        * gui/e-week-view.c: (process_component): Free memory returned 
        by e_cal_component_get_recurid_as_string.                                                       


svn path=/trunk/; revision=35086
This commit is contained in:
Chenthill Palanisamy
2008-02-25 11:00:13 +00:00
committed by Chenthill Palanisamy
parent 79a8efeece
commit f3c82ae09d
5 changed files with 29 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2008-02-25 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #516498
* gui/comp-util.c: (cal_comp_is_on_server):
* gui/e-calendar-view.c: (e_calendar_view_cut_clipboard),
(delete_event), (e_calendar_view_delete_selected_occurrence):
* gui/e-day-view.c: (process_component):
* gui/e-week-view.c: (process_component): Free memory returned
by e_cal_component_get_recurid_as_string.
2008-02-24 Chenthill Palanisamy <pchenthill@novell.com>
Fixes#516408
@ -22,7 +32,6 @@
(reply_to_calendar_comp), (itip_publish_comp): Free the memory
returned by libical
2008-02-20 Milan Crha <mcrha@redhat.com>
** Fix for bug #440426

View File

@ -207,7 +207,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp,
gboolean
cal_comp_is_on_server (ECalComponent *comp, ECal *client)
{
const char *uid, *rid = NULL;
const char *uid;
char *rid = NULL;
icalcomponent *icalcomp;
GError *error = NULL;
@ -232,6 +233,7 @@ cal_comp_is_on_server (ECalComponent *comp, ECal *client)
if (e_cal_get_object (client, uid, rid, &icalcomp, &error)) {
icalcomponent_free (icalcomp);
g_free (rid);
return TRUE;
}
@ -240,6 +242,7 @@ cal_comp_is_on_server (ECalComponent *comp, ECal *client)
g_warning (G_STRLOC ": %s", error->message);
g_clear_error (&error);
g_free (rid);
return FALSE;
}

View File

@ -696,7 +696,7 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view)
e_cal_component_get_uid (comp, &uid);
if (e_cal_component_is_instance (comp)) {
const char *rid;
char *rid = NULL;
icalcomponent *icalcomp;
/* when cutting detached instances, only cut that instance */
@ -709,6 +709,7 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view)
} else
e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL,
CALOBJ_MOD_ALL, &error);
g_free (rid);
} else
e_cal_remove_object (event->comp_data->client, uid, &error);
delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
@ -958,6 +959,7 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
if (delete) {
const char *uid;
char *rid = NULL;
if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp))
&& cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
@ -971,15 +973,16 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
g_object_unref (comp);
return;
}
rid = e_cal_component_get_recurid_as_string (comp);
if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
e_cal_remove_object_with_mod (event->comp_data->client, uid,
e_cal_component_get_recurid_as_string (comp), CALOBJ_MOD_ALL, &error);
rid, CALOBJ_MOD_ALL, &error);
else
e_cal_remove_object (event->comp_data->client, uid, &error);
delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
g_clear_error (&error);
g_free (rid);
}
g_object_unref (comp);
@ -1069,7 +1072,8 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
delete = delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view));
if (delete) {
const char *uid, *rid = NULL;
const char *uid;
char *rid = NULL;
ECalComponentDateTime dt;
icaltimezone *zone = NULL;
gboolean is_instance = FALSE;
@ -1128,6 +1132,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
g_clear_error (&error);
g_free (rid);
}
/* free memory */

View File

@ -517,7 +517,8 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
static void
process_component (EDayView *day_view, ECalModelComponent *comp_data)
{
const char *uid, *rid;
const char *uid;
char *rid = NULL;
ECalComponent *comp;
AddEventData add_event_data;
@ -546,6 +547,7 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data)
e_day_view_add_event (comp, comp_data->instance_start, comp_data->instance_end, &add_event_data);
g_object_unref (comp);
g_free (rid);
}
static void

View File

@ -303,7 +303,8 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data)
ECalComponent *comp = NULL;
AddEventData add_event_data;
/* rid is never used in this function? */
const char *uid, *rid;
const char *uid;
char *rid = NULL;
/* If we don't have a valid date set yet, just return. */
if (!g_date_valid (&week_view->first_day_shown))
@ -329,6 +330,7 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data)
e_week_view_add_event (comp, comp_data->instance_start, comp_data->instance_end, FALSE, &add_event_data);
g_object_unref (comp);
g_free (rid);
}
static void