evolution r35086 - in trunk/calendar: . gui



Author: pchen
Date: Mon Feb 25 11:00:13 2008
New Revision: 35086
URL: http://svn.gnome.org/viewvc/evolution?rev=35086&view=rev

Log:
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.                                                       



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/comp-util.c
   trunk/calendar/gui/e-calendar-view.c
   trunk/calendar/gui/e-day-view.c
   trunk/calendar/gui/e-week-view.c

Modified: trunk/calendar/gui/comp-util.c
==============================================================================
--- trunk/calendar/gui/comp-util.c	(original)
+++ trunk/calendar/gui/comp-util.c	Mon Feb 25 11:00:13 2008
@@ -207,7 +207,8 @@
 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 @@
 
 	if (e_cal_get_object (client, uid, rid, &icalcomp, &error)) {
 		icalcomponent_free (icalcomp);
+		g_free (rid);
 
 		return TRUE;
 	}
@@ -240,6 +242,7 @@
 		g_warning (G_STRLOC ": %s", error->message);
 
 	g_clear_error (&error);
+	g_free (rid);
 
 	return FALSE;
 }

Modified: trunk/calendar/gui/e-calendar-view.c
==============================================================================
--- trunk/calendar/gui/e-calendar-view.c	(original)
+++ trunk/calendar/gui/e-calendar-view.c	Mon Feb 25 11:00:13 2008
@@ -696,7 +696,7 @@
 
 		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 @@
 			} 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 @@
 
 	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 @@
 			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 @@
 		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 @@
 
 		delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
 		g_clear_error (&error);
+		g_free (rid);
 	}
 
 	/* free memory */

Modified: trunk/calendar/gui/e-day-view.c
==============================================================================
--- trunk/calendar/gui/e-day-view.c	(original)
+++ trunk/calendar/gui/e-day-view.c	Mon Feb 25 11:00:13 2008
@@ -517,7 +517,8 @@
 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 @@
 	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

Modified: trunk/calendar/gui/e-week-view.c
==============================================================================
--- trunk/calendar/gui/e-week-view.c	(original)
+++ trunk/calendar/gui/e-week-view.c	Mon Feb 25 11:00:13 2008
@@ -303,7 +303,8 @@
 	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 @@
 	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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]