aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/gui/e-cal-model-calendar.c12
-rw-r--r--calendar/gui/e-cal-model-tasks.c20
-rw-r--r--calendar/gui/e-cal-model.c5
-rw-r--r--calendar/gui/e-cal-model.h2
5 files changed, 32 insertions, 20 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 94f4c3fd3f..ac913678b6 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,18 @@
2003-10-27 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/e-cal-model.h: changed fill_component_from_model virtual
+ method to get an ETableModel, not an ECalModel.
+
+ * gui/e-cal-model.c (ecm_append_row): the source model sent from
+ ETable is an ETableModel, not an ECalModel.
+
+ * gui/e-cal-model-calendar.c (ecmc_fill_component_from_model):
+ get an ETableModel for the 'source_model' argument.
+
+ * gui/e-cal-model-tasks.c (ecmt_fill_component_from_model): ditto.
+
+2003-10-27 Rodrigo Moya <rodrigo@ximian.com>
+
* gui/tasks-component.c (add_uri_for_source): pass FALSE as the
'only_if_exists' parameter, so that the calendar gets created when
it still does not exist.
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
index 593d342e70..fc44d29862 100644
--- a/calendar/gui/e-cal-model-calendar.c
+++ b/calendar/gui/e-cal-model-calendar.c
@@ -44,7 +44,7 @@ static gboolean ecmc_value_is_empty (ETableModel *etm, int col, const void *valu
static char *ecmc_value_to_string (ETableModel *etm, int col, const void *value);
static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ECalModel *source_model, gint row);
+ ETableModel *source_model, gint row);
static GObjectClass *parent_class = NULL;
@@ -441,18 +441,18 @@ ecmc_value_to_string (ETableModel *etm, int col, const void *value)
static void
ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ECalModel *source_model, gint row)
+ ETableModel *source_model, gint row)
{
g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
g_return_if_fail (comp_data != NULL);
- g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (source_model));
+ g_return_if_fail (E_IS_TABLE_MODEL (source_model));
set_dtend (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_DTEND, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row));
set_location (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row));
set_transparency (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row));
}
/**
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index 76e2e140f3..5442c92485 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -48,7 +48,7 @@ static char *ecmt_value_to_string (ETableModel *etm, int col, const void *value)
static const char *ecmt_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data);
static void ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ECalModel *source_model, gint row);
+ ETableModel *source_model, gint row);
static GObjectClass *parent_class = NULL;
@@ -970,26 +970,26 @@ ecmt_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data)
static void
ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ECalModel *source_model, gint row)
+ ETableModel *source_model, gint row)
{
g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
g_return_if_fail (comp_data != NULL);
- g_return_if_fail (E_IS_CAL_MODEL_TASKS (source_model));
+ g_return_if_fail (E_IS_TABLE_MODEL (source_model));
set_completed ((ECalModelTasks *) model, comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_COMPLETED, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_COMPLETED, row));
set_due (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_DUE, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row));
set_geo (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_GEO, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row));
set_percent (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_PERCENT, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PERCENT, row));
set_priority (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_PRIORITY, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row));
set_status (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_STATUS, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row));
set_url (comp_data,
- e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_TASKS_FIELD_URL, row));
+ e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row));
}
/**
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index c8b706c66e..4fc9285b2a 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -652,11 +652,10 @@ ecm_append_row (ETableModel *etm, ETableModel *source, int row)
{
ECalModelClass *model_class;
ECalModelComponent comp_data;
- ECalModel *source_model = (ECalModel *) source;
ECalModel *model = (ECalModel *) etm;
g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (E_IS_CAL_MODEL (source_model));
+ g_return_if_fail (E_IS_TABLE_MODEL (source));
memset (&comp_data, 0, sizeof (comp_data));
comp_data.client = e_cal_model_get_default_client (model);
@@ -677,7 +676,7 @@ ecm_append_row (ETableModel *etm, ETableModel *source, int row)
/* call the class' method for filling the component */
model_class = (ECalModelClass *) G_OBJECT_GET_CLASS (model);
if (model_class->fill_component_from_model != NULL) {
- model_class->fill_component_from_model (model, &comp_data, source_model, row);
+ model_class->fill_component_from_model (model, &comp_data, source, row);
}
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
index 9c673ca439..6a94414676 100644
--- a/calendar/gui/e-cal-model.h
+++ b/calendar/gui/e-cal-model.h
@@ -74,7 +74,7 @@ typedef struct {
/* virtual methods */
const gchar * (* get_color_for_component) (ECalModel *model, ECalModelComponent *comp_data);
void (* fill_component_from_model) (ECalModel *model, ECalModelComponent *comp_data,
- ECalModel *source_model, gint row);
+ ETableModel *source_model, gint row);
} ECalModelClass;
GType e_cal_model_get_type (void);