diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2009-01-30 17:38:57 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2009-01-30 17:38:57 +0800 |
commit | dfdaafa8816cf75e3a9a482c1bcbf4b54c331935 (patch) | |
tree | ce47168a67c21a06e015e15f7e0ad507641c7898 /calendar/gui/e-meeting-store.c | |
parent | d4d9c8155982362c95c256e851d14d63f3ee7fbd (diff) | |
download | gsoc2013-evolution-dfdaafa8816cf75e3a9a482c1bcbf4b54c331935.tar.gz gsoc2013-evolution-dfdaafa8816cf75e3a9a482c1bcbf4b54c331935.tar.zst gsoc2013-evolution-dfdaafa8816cf75e3a9a482c1bcbf4b54c331935.zip |
Fix for bug #450554 (bugzilla.novell.com) - Remove all attendees from the list-view and name-selector before populating it on 'event_changed' callback.
svn path=/trunk/; revision=37191
Diffstat (limited to 'calendar/gui/e-meeting-store.c')
-rw-r--r-- | calendar/gui/e-meeting-store.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 663de70ba8..d320198ec3 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -780,7 +780,7 @@ e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attende gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path); gtk_tree_path_free (path); - g_ptr_array_remove_index (store->priv->attendees, row); + g_ptr_array_remove_index (store->priv->attendees, row); g_object_unref (attendee); } } @@ -788,22 +788,20 @@ e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attende void e_meeting_store_remove_all_attendees (EMeetingStore *store) { - gint i; - GtkTreePath *path = gtk_tree_path_new (); - - gtk_tree_path_append_index (path, 0); - - for (i = 0; i < store->priv->attendees->len; i++) { - EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, i); - + gint i, j, k; + + for (i = 0, j = e_meeting_store_count_actual_attendees (store), k = 0; i < j; i++) { + /* Always try to remove the attendee at index 0 since it is the only one that will + * continue to exist until all attendees are removed. */ + EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, k); + GtkTreePath *path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, k); gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path); - gtk_tree_path_next (path); + gtk_tree_path_free (path); + g_ptr_array_remove_index (store->priv->attendees, k); g_object_unref (attendee); } - - g_ptr_array_set_size (store->priv->attendees, 0); - gtk_tree_path_free (path); } EMeetingAttendee * |