diff options
Diffstat (limited to 'gtk/packet_list_store.c')
-rw-r--r-- | gtk/packet_list_store.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gtk/packet_list_store.c b/gtk/packet_list_store.c index 7b596a9b31..e7c7eb163d 100644 --- a/gtk/packet_list_store.c +++ b/gtk/packet_list_store.c @@ -516,25 +516,37 @@ new_packet_list_new(void) return newpacketlist; } -void -new_packet_list_store_clear(PacketList *packet_list) +#if 0 +static void +packet_list_row_deleted(PacketList *packet_list, guint pos) { GtkTreePath *path; - guint i; + /* Inform the tree view and other interested objects (such as tree row + * references) that we have deleted a row */ + path = gtk_tree_path_new(); + gtk_tree_path_append_index(path, pos); + + gtk_tree_model_row_deleted(GTK_TREE_MODEL(packet_list), path); + + gtk_tree_path_free(path); +} +#endif + +void +new_packet_list_store_clear(PacketList *packet_list) +{ g_return_if_fail(packet_list != NULL); g_return_if_fail(PACKETLIST_IS_LIST(packet_list)); if(packet_list->num_rows == 0) return; - path = gtk_tree_path_new(); - - for(i = 0; i < packet_list->num_rows; ++i) { - gtk_tree_model_row_deleted(GTK_TREE_MODEL(packet_list), path); - } - - gtk_tree_path_free(path); + /* Don't issue a row_deleted signal. We rely on our caller to have disconnected + * the model from the view. + for( ; packet_list->num_rows > 0; --packet_list->num_rows) + packet_list_row_deleted(packet_list, packet_list->num_rows-1); + */ /* XXX - hold on to these rows and reuse them instead */ g_free(packet_list->rows); |