diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-02-09 23:00:47 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-02-09 23:00:47 +0800 |
commit | 0f91739965d3c701a198062c4f7af39aff401a7f (patch) | |
tree | cd6e42e7c7e56238a450379fd5f7b9bb7e0ccc5a | |
parent | 3b73c55963d022faeb3538294c8a7d514dabbe13 (diff) | |
download | gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar.gz gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar.bz2 gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar.lz gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar.xz gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.tar.zst gsoc2013-evolution-0f91739965d3c701a198062c4f7af39aff401a7f.zip |
don't add the clients to the internal hash/list here, just remove it if
2004-02-09 Rodrigo Moya <rodrigo@ximian.com>
* gui/gnome-cal.c (client_cal_opened_cb): don't add the clients to the
internal hash/list here, just remove it if opening the calendar fails.
(gnome_calendar_add_event_source): add the client to the internal
hash/list here.
svn path=/trunk/; revision=24682
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 23 |
2 files changed, 25 insertions, 5 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 7a5e44bb8f..4484f2711d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-02-09 Rodrigo Moya <rodrigo@ximian.com> + + * gui/gnome-cal.c (client_cal_opened_cb): don't add the clients to the + internal hash/list here, just remove it if opening the calendar fails. + (gnome_calendar_add_event_source): add the client to the internal + hash/list here. + 2004-02-09 Kidd Wang <kidd.wang@sun.com> * gui/e-cal-model-tasks.c: (ecmt_set_value_at): refuse to update diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index bd9d8aba4d..40f40a8513 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1751,10 +1751,6 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) } else { int i; - /* add the client to internal structure */ - g_hash_table_insert (priv->clients, g_strdup (e_cal_get_uri (ecal)), ecal); - priv->clients_list = g_list_prepend (priv->clients_list, ecal); - /* add client to the views */ for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { ECalModel *model; @@ -1766,8 +1762,21 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) /* update date navigator query */ update_query (gcal); } - } else + } else { + if (ecal != priv->task_pad_client) { + gpointer orig_uid; + gpointer orig_client; + + if (g_hash_table_lookup_extended (priv->clients, e_cal_get_uri (ecal), &orig_uid, &orig_client)) { + g_hash_table_remove (priv->clients, e_cal_get_uri (ecal)); + g_free (orig_uid); + } + + priv->clients_list = g_list_append (priv->clients_list, ecal); + } + g_object_unref (ecal); + } } static gboolean @@ -2117,6 +2126,10 @@ gnome_calendar_add_event_source (GnomeCalendar *gcal, ESource *source) g_signal_connect (G_OBJECT (client), "categories_changed", G_CALLBACK (client_categories_changed_cb), gcal); g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), gcal); + /* add the client to internal structure */ + g_hash_table_insert (priv->clients, g_strdup (e_cal_get_uri (client)), client); + priv->clients_list = g_list_prepend (priv->clients_list, client); + open_ecal (gcal, client, FALSE); return TRUE; |