[evolution-patches] patch for #34498



? gui/alarm-notify/alarm-notify.gladep
? gui/dialogs/alarm-options.gladep
? gui/dialogs/alarm-page.gladep
? gui/dialogs/cal-prefs-dialog.gladep
? gui/dialogs/e-delegate-dialog.gladep
? gui/dialogs/event-page.gladep
? gui/dialogs/meeting-page.gladep
? gui/dialogs/recurrence-page.gladep
? gui/dialogs/schedule-page.gladep
? gui/dialogs/task-details-page.gladep
? gui/dialogs/task-page.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1737
diff -u -p -r1.1737 ChangeLog
--- ChangeLog	16 Apr 2003 20:31:05 -0000	1.1737
+++ ChangeLog	17 Apr 2003 11:14:04 -0000
@@ -1,3 +1,14 @@
+2003-04-17  Rodrigo Moya <rodrigo ximian com>
+
+	Fixes #34498
+
+	* gui/alarm-notify/alarm-queue.c: added a 'uid' field to the
+	CompQueuedAlarms structure.
+	(remove_queued_alarm): free the 'uid' field when freeing the
+	structure.
+	(add_component_alarms): g_strdup the component's UID and use that as
+	the key for the hash table.
+
 2003-04-16  Rodrigo Moya <rodrigo ximian com>
 
 	Fixes #41129, #41215, #41221, #41256
Index: gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.33
diff -u -p -r1.33 alarm-queue.c
--- gui/alarm-notify/alarm-queue.c	10 Apr 2003 15:10:32 -0000	1.33
+++ gui/alarm-notify/alarm-queue.c	17 Apr 2003 11:14:04 -0000
@@ -82,6 +82,9 @@ typedef struct {
 	/* The parent client alarms structure */
 	ClientAlarms *parent_client;
 
+	/* The component's UID */
+	char *uid;
+
 	/* The actual component and its alarm instances */
 	CalComponentAlarms *alarms;
 
@@ -200,7 +203,6 @@ remove_queued_alarm (CompQueuedAlarms *c
 		     gboolean free_object, gboolean remove_alarm)
 {
 	QueuedAlarm *qa;
-	const char *uid;
 	GSList *l;
 
 	qa = NULL;
@@ -236,8 +238,9 @@ remove_queued_alarm (CompQueuedAlarms *c
 		return;
 
 	if (free_object) {
-		cal_component_get_uid (cqa->alarms->comp, &uid);
-		g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid);
+		g_hash_table_remove (cqa->parent_client->uid_alarms_hash, cqa->uid);
+		g_free (cqa->uid);
+		cqa->uid = NULL;
 		cqa->parent_client = NULL;
 		cal_component_alarms_free (cqa->alarms);
 		g_free (cqa);
@@ -362,7 +365,8 @@ add_component_alarms (ClientAlarms *ca, 
 	}
 
 	cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
-	g_hash_table_insert (ca->uid_alarms_hash, (char *) uid, cqa);
+	cqa->uid = g_strdup (uid);
+	g_hash_table_insert (ca->uid_alarms_hash, cqa->uid, cqa);
 }
 
 /* Loads the alarms of a client for a given range of time */


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