From 350bdccc968a80bc7819d1bc7c302584c165b771 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 17 Dec 2003 11:59:47 +0000 Subject: make sure we free the data stored in the hash table. 2003-12-17 Rodrigo Moya * gui/alarm-notify/alarm-notify.c (alarm_notify_remove_calendar): make sure we free the data stored in the hash table. (alarm_notify_add_calendar): call alarm_queue_add_client, or we wont have alarms at all. * gui/alarm-notify/alarm-queue.c: no need to hold a ref count. (alarm_queue_add_client, alarm_queue_remove_client): don't use the refcount private member. (alarm_queue_add_client): don't connect to non-existing ECal signals. (display_notification, free_client_alarms_cb): fixed warnings. svn path=/trunk/; revision=23960 --- calendar/gui/alarm-notify/alarm-queue.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 2cf95f47b7..e97761fc89 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -69,9 +69,6 @@ typedef struct { /* Monitored client */ ECal *client; - /* Number of times this client has been registered */ - int refcount; - /* Hash table of component UID -> CompQueuedAlarms. If an element is * present here, then it means its cqa->queued_alarms contains at least * one queued alarm. When all the alarms for a component have been @@ -840,7 +837,6 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, { QueuedAlarm *qa; ECalComponent *comp; - ECal *client; ECalComponentVType vtype; const char *message; ECalComponentAlarm *alarm; @@ -1126,7 +1122,6 @@ alarm_queue_init (void) static void free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) { - ECal *client = key; ClientAlarms *ca = value; if (ca) { @@ -1186,7 +1181,6 @@ alarm_queue_add_client (ECal *client) ca = lookup_client (client); if (ca) { - ca->refcount++; return; } @@ -1195,7 +1189,6 @@ alarm_queue_add_client (ECal *client) ca->client = client; g_object_ref (ca->client); - ca->refcount = 1; g_hash_table_insert (client_alarms_hash, client, ca); ca->uid_alarms_hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -1205,13 +1198,6 @@ alarm_queue_add_client (ECal *client) G_CALLBACK (cal_opened_cb), ca); - g_signal_connect (client, "obj_updated", - G_CALLBACK (obj_updated_cb), - ca); - g_signal_connect (client, "obj_removed", - G_CALLBACK (obj_removed_cb), - ca); - if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) { load_alarms_for_today (ca); load_missed_alarms (ca); @@ -1276,12 +1262,6 @@ alarm_queue_remove_client (ECal *client) ca = lookup_client (client); g_return_if_fail (ca != NULL); - g_assert (ca->refcount > 0); - ca->refcount--; - - if (ca->refcount > 0) - return; - remove_client_alarms (ca); /* Clean up */ -- cgit v1.2.3