aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-04-08 03:30:55 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-04-08 03:30:55 +0800
commitc57a7ccfef4a1c9501499378d91e4efbe3d0b606 (patch)
tree2567d177b89b4244dfc25f7110e5281668264ad4 /calendar/gui/e-cal-model.c
parente21dfa011d14bcc964034c646e28f2674183341e (diff)
downloadgsoc2013-evolution-c57a7ccfef4a1c9501499378d91e4efbe3d0b606.tar.gz
gsoc2013-evolution-c57a7ccfef4a1c9501499378d91e4efbe3d0b606.tar.zst
gsoc2013-evolution-c57a7ccfef4a1c9501499378d91e4efbe3d0b606.zip
just add the client, we have protection against re-adding it any how
2004-04-07 JP Rosevear <jpr@ximian.com> * gui/e-cal-model.c (e_cal_model_set_default_client): just add the client, we have protection against re-adding it any how (cal_opened_cb): stop listening to the open signal svn path=/trunk/; revision=25359
Diffstat (limited to 'calendar/gui/e-cal-model.c')
-rw-r--r--calendar/gui/e-cal-model.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index da375d00e9..c96d3a31f5 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1075,20 +1075,11 @@ e_cal_model_set_default_client (ECalModel *model, ECal *client)
priv = model->priv;
- /* See if we already know about the client */
- for (l = priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data = l->data;
-
- if (client == client_data->client)
- found = TRUE;
- }
+ /* Make sure its in the model */
+ e_cal_model_add_client (model, client);
- /* If its not found, add it */
- if (!found)
- e_cal_model_add_client (model, client);
-
- /* Store the default client */
- priv->default_client = client;
+ /* Store the default client */
+ priv->default_client = e_cal_model_get_client_for_uri (model, e_cal_get_uri (client));
}
/**
@@ -1312,7 +1303,7 @@ update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data)
/* Skip if this client has not finished loading yet */
if (e_cal_get_load_state (client_data->client) != E_CAL_LOAD_LOADED)
return;
-
+
/* free the previous query, if any */
if (client_data->query) {
g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA,
@@ -1354,13 +1345,16 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data)
{
ECalModel *model = (ECalModel *) user_data;
ECalModelClient *client_data;
-
+
if (status != E_CALENDAR_STATUS_OK) {
e_cal_model_remove_client (model, client);
return;
}
+ /* Stop listening for this calendar to be opened */
+ g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model);
+
client_data = find_client_data (model, client);
g_assert (client_data);