From e5d4f6b7d22530f4642aa98c55029398ee943b5d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 13 Jul 2004 11:07:19 +0000 Subject: as below 2004-07-08 Radek Doulik * gui/e-cal-model.c (e_cal_model_date_value_to_string): as below * gui/e-cal-model-calendar.c (ecmc_value_to_string): as below * gui/e-cal-model.c (ecm_value_to_string): as below * gui/e-cal-model-tasks.c (ecmt_value_to_string): dup the string value, it's free-ed later. instead of returning NULL return g_strdup ("") as gal does Fixes #56271 svn path=/trunk/; revision=26634 --- calendar/gui/calendar-view-factory.c | 2 ++ calendar/gui/e-cal-model-calendar.c | 4 ++-- calendar/gui/e-cal-model-tasks.c | 8 ++++---- calendar/gui/e-cal-model.c | 16 ++++++++-------- calendar/gui/gnome-cal.c | 4 ++++ 5 files changed, 20 insertions(+), 14 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c index f8d2d92ce3..4c3f83572d 100644 --- a/calendar/gui/calendar-view-factory.c +++ b/calendar/gui/calendar-view-factory.c @@ -173,6 +173,8 @@ calendar_view_factory_new_view (GalViewFactory *factory, const char *name) priv = cal_view_factory->priv; cal_view = calendar_view_new (priv->view_type, name); + gal_view_set_built_in (GAL_VIEW (cal_view), TRUE); + return GAL_VIEW (cal_view); } diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index e6aba158da..3649352372 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -463,7 +463,7 @@ ecmc_value_is_empty (ETableModel *etm, int col, const void *value) static char * ecmc_value_to_string (ETableModel *etm, int col, const void *value) { - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); + g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, g_strdup ("")); if (col < E_CAL_MODEL_FIELD_LAST) return E_TABLE_MODEL_CLASS (parent_class)->value_to_string (etm, col, value); @@ -476,7 +476,7 @@ ecmc_value_to_string (ETableModel *etm, int col, const void *value) return g_strdup (value); } - return NULL; + return g_strdup (""); } /* ECalModel class methods */ diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 7c0fb08638..463f812c8f 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -992,8 +992,8 @@ ecmt_value_to_string (ETableModel *etm, int col, const void *value) { ECalModelTasks *model = (ECalModelTasks *) etm; - g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL); - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL); + g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), g_strdup ("")); + g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, g_strdup ("")); if (col < E_CAL_MODEL_FIELD_LAST) return E_TABLE_MODEL_CLASS (parent_class)->value_to_string (etm, col, value); @@ -1009,7 +1009,7 @@ ecmt_value_to_string (ETableModel *etm, int col, const void *value) return e_cal_model_date_value_to_string (E_CAL_MODEL (model), value); case E_CAL_MODEL_TASKS_FIELD_COMPLETE : case E_CAL_MODEL_TASKS_FIELD_OVERDUE : - return value ? _("Yes") : _("No"); + return g_strdup (value ? _("Yes") : _("No")); case E_CAL_MODEL_TASKS_FIELD_PERCENT : if (GPOINTER_TO_INT (value) < 0) return g_strdup ("N/A"); @@ -1017,7 +1017,7 @@ ecmt_value_to_string (ETableModel *etm, int col, const void *value) return g_strdup_printf ("%i%%", GPOINTER_TO_INT (value)); } - return NULL; + return g_strdup (""); } /* ECalModel class methods */ diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index e315323472..c2d4fc57ad 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -894,7 +894,7 @@ ecm_value_is_empty (ETableModel *etm, int col, const void *value) static char * ecm_value_to_string (ETableModel *etm, int col, const void *value) { - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL); + g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, g_strdup ("")); switch (col) { case E_CAL_MODEL_FIELD_CATEGORIES : @@ -906,19 +906,19 @@ ecm_value_to_string (ETableModel *etm, int col, const void *value) return e_cal_model_date_value_to_string (E_CAL_MODEL (etm), value); case E_CAL_MODEL_FIELD_ICON : if (GPOINTER_TO_INT (value) == 0) - return _("Normal"); + return g_strdup (_("Normal")); else if (GPOINTER_TO_INT (value) == 1) - return _("Recurring"); + return g_strdup (_("Recurring")); else - return _("Assigned"); + return g_strdup (_("Assigned")); case E_CAL_MODEL_FIELD_HAS_ALARMS : - return value ? _("Yes") : _("No"); + return g_strdup (value ? _("Yes") : _("No")); case E_CAL_MODEL_FIELD_COLOR : case E_CAL_MODEL_FIELD_COMPONENT : - return NULL; + return g_strdup (""); } - return NULL; + return g_strdup (""); } /* ECalModel class methods */ @@ -1787,7 +1787,7 @@ e_cal_model_date_value_to_string (ECalModel *model, const void *value) struct tm tmp_tm; char buffer[64]; - g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); + g_return_val_if_fail (E_IS_CAL_MODEL (model), g_strdup ("")); priv = model->priv; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 034c0be1bd..dc43fcdf45 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1822,6 +1822,7 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic) /* Create the view instance */ if (collection == NULL) { ETableSpecification *spec; + GalView *view; collection = gal_view_collection_new (); @@ -1863,6 +1864,9 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic) gal_view_collection_load (collection); + view = gal_view_collection_get_view (collection, gal_view_collection_get_view_index_by_id (collection, "List_View")); + if (view) + gal_view_set_built_in (view, TRUE); } priv->view_instance = gal_view_instance_new (collection, NULL); -- cgit v1.2.3