aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-notify.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-03-10 19:53:36 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-03-10 19:53:36 +0800
commit6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2 (patch)
treee781beaf534ee8f97a4d9e2389ce93dfffe4e689 /calendar/gui/alarm-notify/alarm-notify.c
parentc8a1141a55840d16dca6fc863d8fbab7d0b4ab26 (diff)
downloadgsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar.gz
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar.bz2
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar.lz
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar.xz
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.tar.zst
gsoc2013-evolution-6c2bba29f7cfa297e4fb0a9f60ac90f430c1e3e2.zip
if we already have the client loaded, don't remove it, just increment its
2003-03-09 Rodrigo Moya <rodrigo@ximian.com> * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): if we already have the client loaded, don't remove it, just increment its reference count. * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added new argument to specify whether we want the component's structure removed if no more alarms exist, and only free the structure if TRUE. (remove_alarms): added same new argument and pass it over to remove_queued_alarm. (remove_comp, obj_updated_cb): passed new argument to remove_alarms. (procedure_notification): passed new argument to remove_queued_alarm. (obj_removed_cb): set all freed pointers to NULL. (notify_dialog_cb): only remove the alarm if the pointers are not NULL. svn path=/trunk/; revision=20232
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-notify.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index aefdceeeb1..fb1491bea9 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -441,7 +441,9 @@ alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_a
lc = lc_ptr;
s = s_ptr;
- g_hash_table_remove (priv->uri_client_hash, str_uri);
+ lc->refcount++;
+
+ /*g_hash_table_remove (priv->uri_client_hash, str_uri);
g_signal_handlers_disconnect_matched (G_OBJECT (lc->client),
G_SIGNAL_MATCH_DATA,
@@ -453,40 +455,38 @@ alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_a
e_uri_free (lc->uri);
g_free (lc);
- g_free (s);
- }
-
- client = cal_client_new ();
-
- if (client) {
- /* we only add the URI to load_afterwards if we open it
- correctly */
- lc = g_new (LoadedClient, 1);
-
- g_signal_connect (G_OBJECT (client), "cal_opened",
- G_CALLBACK (cal_opened_cb),
- lc);
-
- if (cal_client_open_calendar (client, str_uri, FALSE)) {
- lc->client = client;
- lc->uri = uri;
- lc->refcount = 1;
- lc->timeout_id = -1;
- g_hash_table_insert (priv->uri_client_hash,
- g_strdup (str_uri), lc);
+ g_free (s);*/
+ } else {
+ client = cal_client_new ();
+
+ if (client) {
+ /* we only add the URI to load_afterwards if we open it
+ correctly */
+ lc = g_new (LoadedClient, 1);
+
+ g_signal_connect (G_OBJECT (client), "cal_opened",
+ G_CALLBACK (cal_opened_cb),
+ lc);
+
+ if (cal_client_open_calendar (client, str_uri, FALSE)) {
+ lc->client = client;
+ lc->uri = uri;
+ lc->refcount = 1;
+ lc->timeout_id = -1;
+ g_hash_table_insert (priv->uri_client_hash,
+ g_strdup (str_uri), lc);
+ } else {
+ g_free (lc);
+ g_object_unref (G_OBJECT (client));
+ client = NULL;
+ }
} else {
- g_free (lc);
- g_object_unref (G_OBJECT (client));
- client = NULL;
- }
- }
-
- if (!client) {
- e_uri_free (uri);
+ e_uri_free (uri);
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Calendar_AlarmNotify_BackendContactError,
- NULL);
- return;
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_GNOME_Evolution_Calendar_AlarmNotify_BackendContactError,
+ NULL);
+ return;
+ }
}
}