diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-01-15 00:37:49 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-01-15 00:37:49 +0800 |
commit | 87ca42db1dcf2b0f4d095a7b0c769bfc08246e77 (patch) | |
tree | 9b3fc9be5fd4a46971ddc582257f482139eb57e0 /calendar/gui/gnome-cal.c | |
parent | 5dffd5377bdb30c20f22553dd1482186ff322b6a (diff) | |
download | gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.gz gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.zst gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.zip |
check return value from e_cal_new().
2004-01-14 Rodrigo Moya <rodrigo@ximian.com>
* common/authentication.c (auth_new_cal_from_source): check
return value from e_cal_new().
* gui/gnome-cal.c (gnome_calendar_construct): if there is no
default tasks folder, don't create the ECal from it.
svn path=/trunk/; revision=24219
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 1ae884d38d..05194a30b3 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1948,34 +1948,33 @@ gnome_calendar_construct (GnomeCalendar *gcal) uid = calendar_config_get_primary_tasks (); if (uid) { ESourceList *source_list; + ESource *tasks_source; GConfClient *conf_client; conf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (conf_client, "/apps/evolution/tasks/sources"); - priv->task_pad_client = auth_new_cal_from_source ( - e_source_list_peek_source_by_uid (source_list, uid), E_CAL_SOURCE_TYPE_TODO); + tasks_source = e_source_list_peek_source_by_uid (source_list, uid); + if (tasks_source) { + priv->task_pad_client = auth_new_cal_from_source (tasks_source, E_CAL_SOURCE_TYPE_TODO); - g_object_unref (conf_client); - g_object_unref (source_list); - - if (!priv->task_pad_client) - return NULL; + g_signal_connect (priv->task_pad_client, "backend_error", + G_CALLBACK (backend_error_cb), gcal); + g_signal_connect (priv->task_pad_client, "categories_changed", + G_CALLBACK (client_categories_changed_cb), gcal); + g_signal_connect (priv->task_pad_client, "backend_died", + G_CALLBACK (backend_died_cb), gcal); - g_signal_connect (priv->task_pad_client, "backend_error", - G_CALLBACK (backend_error_cb), gcal); - g_signal_connect (priv->task_pad_client, "categories_changed", - G_CALLBACK (client_categories_changed_cb), gcal); - g_signal_connect (priv->task_pad_client, "backend_died", - G_CALLBACK (backend_died_cb), gcal); + if (open_ecal (gcal, priv->task_pad_client, TRUE)) { + e_cal_model_add_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), + priv->task_pad_client); + } + } else + priv->task_pad_client = NULL; + g_object_unref (conf_client); + g_object_unref (source_list); g_free (uid); - - if (!open_ecal (gcal, priv->task_pad_client, TRUE)) - return NULL; - - e_cal_model_add_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), - priv->task_pad_client); } /* Get the default view to show. */ |