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 | |
parent | 5dffd5377bdb30c20f22553dd1482186ff322b6a (diff) | |
download | gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.gz gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.bz2 gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.lz gsoc2013-evolution-87ca42db1dcf2b0f4d095a7b0c769bfc08246e77.tar.xz 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')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/common/authentication.c | 3 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 |
3 files changed, 28 insertions, 20 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 548852368b..aca86d31e3 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +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. + 2004-01-14 JP Rosevear <jpr@ximian.com> * gui/tasks-component.c (impl_requestCreateItem): don't try to set diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c index 849a2e76c3..ba0eae2893 100644 --- a/calendar/common/authentication.c +++ b/calendar/common/authentication.c @@ -42,7 +42,8 @@ auth_new_cal_from_source (ESource *source, ECalSourceType type) ECal *cal; cal = e_cal_new (source, type); - e_cal_set_auth_func (cal, (ECalAuthFunc) auth_func_cb, NULL); + if (cal) + e_cal_set_auth_func (cal, (ECalAuthFunc) auth_func_cb, NULL); return cal; } 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. */ |