diff options
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 23 |
1 files changed, 18 insertions, 5 deletions
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; |