aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-meeting-model.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-12-04 06:59:20 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-12-04 06:59:20 +0800
commit86755b7d11c4773744cf42ed75667c7cc6aff0c7 (patch)
treeefc12944c08f64a4b585cb86d832524a0e3c62f9 /calendar/gui/e-meeting-model.c
parent35b2f0ce2aded8fc002d76cff57e09aaa9836775 (diff)
downloadgsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.gz
gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.zst
gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.zip
make sure we call e_table_model_pre_change() before changing the model.
2001-12-03 Damon Chaplin <damon@ximian.com> * gui/e-meeting-model.c: * gui/calendar-model.c: make sure we call e_table_model_pre_change() before changing the model. * gui/calendar-config.c (calendar_config_configure_e_calendar_table): removed call to e_table_model_changed(). calendar_model_refresh() results in that anyway. svn path=/trunk/; revision=14854
Diffstat (limited to 'calendar/gui/e-meeting-model.c')
-rw-r--r--calendar/gui/e-meeting-model.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
index f8daf00cf8..d80c95fb41 100644
--- a/calendar/gui/e-meeting-model.c
+++ b/calendar/gui/e-meeting-model.c
@@ -847,6 +847,8 @@ e_meeting_model_add_attendee (EMeetingModel *im, EMeetingAttendee *ia)
priv = im->priv;
+ e_table_model_pre_change (E_TABLE_MODEL (im));
+
gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->attendees, ia);
@@ -908,6 +910,8 @@ e_meeting_model_remove_attendee (EMeetingModel *im, EMeetingAttendee *ia)
}
if (row != -1) {
+ e_table_model_pre_change (E_TABLE_MODEL (im));
+
g_ptr_array_remove_index (priv->attendees, row);
gtk_object_unref (GTK_OBJECT (ia));
@@ -919,17 +923,21 @@ void
e_meeting_model_remove_all_attendees (EMeetingModel *im)
{
EMeetingModelPrivate *priv;
- gint i;
+ gint i, len;
priv = im->priv;
- for (i = 0; i < priv->attendees->len; i++) {
+ e_table_model_pre_change (E_TABLE_MODEL (im));
+
+ len = priv->attendees->len;
+
+ for (i = 0; i < len; i++) {
EMeetingAttendee *ia = g_ptr_array_index (priv->attendees, i);
gtk_object_unref (GTK_OBJECT (ia));
}
- e_table_model_rows_deleted (E_TABLE_MODEL (im), 0, priv->attendees->len);
g_ptr_array_set_size (priv->attendees, 0);
+ e_table_model_rows_deleted (E_TABLE_MODEL (im), 0, len);
}
EMeetingAttendee *
@@ -1613,6 +1621,9 @@ attendee_changed_cb (EMeetingAttendee *ia, gpointer data)
if (row == -1)
return;
+ /* FIXME: Ideally I think you are supposed to call pre_change() before
+ the data structures are changed. */
+ e_table_model_pre_change (E_TABLE_MODEL (im));
e_table_model_row_changed (E_TABLE_MODEL (im), row);
}