aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2005-02-10 16:42:08 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-02-10 16:42:08 +0800
commit2c844a7e57ee20173f990427da26aa4dd0703e1b (patch)
tree137ac8f00bd3c88f9ce7e66cfe2bc2617cf019c3 /calendar/gui/e-cal-model.c
parent3ee8be8e3d25dc2c14a44bcdb71686a213e00b00 (diff)
downloadgsoc2013-evolution-2c844a7e57ee20173f990427da26aa4dd0703e1b.tar.gz
gsoc2013-evolution-2c844a7e57ee20173f990427da26aa4dd0703e1b.tar.zst
gsoc2013-evolution-2c844a7e57ee20173f990427da26aa4dd0703e1b.zip
Remove the component from the view, if its already present before adding
2005-02-10 Chenthill Palanisamy <pchenthill@novell.com> * gui/e-cal-model.c: (e_cal_view_objects_added_cb): Remove the component from the view, if its already present before adding it. svn path=/trunk/; revision=28763
Diffstat (limited to 'calendar/gui/e-cal-model.c')
-rw-r--r--calendar/gui/e-cal-model.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 7b56219e62..f9e7de2003 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1322,6 +1322,20 @@ e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer user_data
priv = model->priv;
for (l = objects; l; l = l->next) {
+ ECalModelComponent *comp_data;
+
+ /* remove the components if they are already present and re-add them */
+ while ((comp_data = search_by_uid_and_client (priv, e_cal_view_get_client (query),
+ icalcomponent_get_uid (l->data)))) {
+ int pos;
+
+ pos = get_position_in_array (priv->objects, comp_data);
+ e_table_model_row_deleted (E_TABLE_MODEL (model), pos);
+
+ g_ptr_array_remove (priv->objects, comp_data);
+ e_cal_model_free_component_data (comp_data);
+ }
+
if ((priv->flags & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES)) {
RecurrenceExpansionData rdata;
@@ -1334,8 +1348,6 @@ e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer user_data
(ECalRecurInstanceFn) add_instance_cb,
&rdata);
} else {
- ECalModelComponent *comp_data;
-
e_table_model_pre_change (E_TABLE_MODEL (model));
comp_data = g_new0 (ECalModelComponent, 1);