aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-04-17 23:39:48 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-04-17 23:39:48 +0800
commit2c4e906e2f15d3894185f69e498ebd7622f992df (patch)
treed09b1f0b6f1428f1556cb0ec6e0f1ffe7c27193f /calendar/gui
parent9c3df9559c86ed9ad69409fe5b92328832d94497 (diff)
downloadgsoc2013-evolution-2c4e906e2f15d3894185f69e498ebd7622f992df.tar.gz
gsoc2013-evolution-2c4e906e2f15d3894185f69e498ebd7622f992df.tar.zst
gsoc2013-evolution-2c4e906e2f15d3894185f69e498ebd7622f992df.zip
Fixes #34498
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. svn path=/trunk/; revision=20879
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index f117e53723..fa04a63daa 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -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 *cqa, gpointer alarm_id,
gboolean free_object, gboolean remove_alarm)
{
QueuedAlarm *qa;
- const char *uid;
GSList *l;
qa = NULL;
@@ -236,8 +238,9 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
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, CalComponentAlarms *alarms)
}
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 */