diff options
author | Damon Chaplin <damon@ximian.com> | 2001-12-04 06:59:20 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-12-04 06:59:20 +0800 |
commit | 86755b7d11c4773744cf42ed75667c7cc6aff0c7 (patch) | |
tree | efc12944c08f64a4b585cb86d832524a0e3c62f9 /calendar | |
parent | 35b2f0ce2aded8fc002d76cff57e09aaa9836775 (diff) | |
download | gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.gz gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.bz2 gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.lz gsoc2013-evolution-86755b7d11c4773744cf42ed75667c7cc6aff0c7.tar.xz 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')
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 5 | ||||
-rw-r--r-- | calendar/gui/calendar-model.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-meeting-model.c | 17 |
4 files changed, 34 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 8409c7c76b..50392c0a88 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,15 @@ 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. + +2001-12-03 Damon Chaplin <damon@ximian.com> + * gui/e-calendar-table.etspec: disabled 'Alarms', 'End Date' and 'Show Time As' fields, as these are not useful for tasks. We may want to reenable them later if we add a table view of calendar events. diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index b5ae415faf..b594423446 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -908,11 +908,6 @@ calendar_config_configure_e_calendar_table (ECalendarTable *cal_table) /* Reload the event/tasks, since the 'Hide Completed Tasks' option may have been changed, so the query needs to be updated. */ calendar_model_refresh (model); - - /* This is for changing the colors of the text; they will be re-fetched - * by ECellText when the table is redrawn. - */ - e_table_model_changed (E_TABLE_MODEL (model)); } diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index e0e4f97d7e..f2b9d8b428 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -1773,6 +1773,8 @@ query_obj_updated_cb (CalQuery *query, const char *uid, model = CALENDAR_MODEL (data); priv = model->priv; + e_table_model_pre_change (E_TABLE_MODEL (model)); + orig_idx = remove_object (model, uid); status = cal_client_get_object (priv->client, uid, &new_comp); @@ -1836,6 +1838,8 @@ query_obj_updated_cb (CalQuery *query, const char *uid, */ if (orig_idx != -1) e_table_model_row_deleted (E_TABLE_MODEL (model), orig_idx); + else + e_table_model_no_change (E_TABLE_MODEL (model)); break; @@ -1845,6 +1849,8 @@ query_obj_updated_cb (CalQuery *query, const char *uid, /* Same notification as above */ if (orig_idx != -1) e_table_model_row_deleted (E_TABLE_MODEL (model), orig_idx); + else + e_table_model_no_change (E_TABLE_MODEL (model)); break; @@ -1862,10 +1868,14 @@ query_obj_removed_cb (CalQuery *query, const char *uid, gpointer data) model = CALENDAR_MODEL (data); + e_table_model_pre_change (E_TABLE_MODEL (model)); + idx = remove_object (model, uid); if (idx != -1) e_table_model_row_deleted (E_TABLE_MODEL (model), idx); + else + e_table_model_no_change (E_TABLE_MODEL (model)); } /* Callback used when a query ends */ 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); } |