aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-model.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2003-03-05 03:52:37 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-03-05 03:52:37 +0800
commit6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62 (patch)
treebba07b5f28966c10a90de8f550af895014b0b9bb /calendar/gui/calendar-model.c
parentcd4477930e72b1be069d5c97b90d96e989645bfc (diff)
downloadgsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.gz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.bz2
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.lz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.xz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.zst
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.zip
If only the pipe wouldn't break.
svn path=/trunk/; revision=20143
Diffstat (limited to 'calendar/gui/calendar-model.c')
-rw-r--r--calendar/gui/calendar-model.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 05d402f139..b7ea5b5348 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -832,7 +832,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row)
if (cal_component_has_recurrences (comp))
return GINT_TO_POINTER (1);
- if (itip_organizer_is_user (comp))
+ if (itip_organizer_is_user (comp, priv->client))
return GINT_TO_POINTER (3);
cal_component_get_attendee_list (comp, &attendees);
@@ -1355,14 +1355,23 @@ calendar_model_append_row (ETableModel *etm, ETableModel *source, gint row)
model = CALENDAR_MODEL (etm);
priv = model->priv;
+ /* Guard against saving before the calendar is open */
+ if (!(priv->client && cal_client_get_load_state (priv->client) == CAL_CLIENT_LOAD_LOADED))
+ return;
+
/* FIXME: This should support other types of components, but for now it
* is only used for the task list.
*/
- if (priv->new_comp_vtype == CAL_COMPONENT_EVENT)
- comp = cal_comp_event_new_with_defaults ();
- else {
+ switch (priv->new_comp_vtype) {
+ case CAL_COMPONENT_EVENT:
+ comp = cal_comp_event_new_with_defaults (priv->client);
+ break;
+ case CAL_COMPONENT_TODO:
+ comp = cal_comp_task_new_with_defaults (priv->client);
+ break;
+ default:
comp = cal_component_new ();
- cal_component_set_new_vtype (comp, priv->new_comp_vtype);
+ cal_component_set_new_vtype (comp, priv->new_comp_vtype);
}
set_categories (comp, e_table_model_value_at(source, CAL_COMPONENT_FIELD_CATEGORIES, row));