diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-07-13 18:14:00 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-07-13 18:14:00 +0000 |
commit | 683c8f587ad9d12f838e487572c00529665a9ac0 (patch) | |
tree | c1161183bbadbf137e1724ceec6a74a4ba3fb8ca | |
parent | fd262f1b97114cc258ace5fee044505ca39c6582 (diff) |
Conversation/Endpoint list performance patch from Ian Schorr
svn path=/trunk/; revision=11373
-rw-r--r-- | gtk/endpoint_talkers_table.c | 21 | ||||
-rw-r--r-- | gtk/hostlist_table.c | 20 |
2 files changed, 26 insertions, 15 deletions
diff --git a/gtk/endpoint_talkers_table.c b/gtk/endpoint_talkers_table.c index 484cc3ec95..aec06db0b4 100644 --- a/gtk/endpoint_talkers_table.c +++ b/gtk/endpoint_talkers_table.c @@ -4,7 +4,7 @@ * endpoint_talkers_table 2003 Ronnie Sahlberg * Helper routines common to all endpoint talkers tap. * - * $Id: endpoint_talkers_table.c,v 1.46 2004/07/10 11:57:19 ulfl Exp $ + * $Id: endpoint_talkers_table.c,v 1.47 2004/07/13 18:14:00 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -225,9 +225,7 @@ reset_ett_table_data(endpoints_table *et) } /* remove all entries from the clist */ - for(i=0;i<et->num_endpoints;i++){ - gtk_clist_remove(et->table, et->num_endpoints-i-1); - } + gtk_clist_clear(et->table); /* delete all endpoints */ for(i=0;i<et->num_endpoints;i++){ @@ -317,9 +315,11 @@ ett_click_column_cb(GtkCList *clist, gint column, gpointer data) gtk_widget_show(col_arrows[column].descend_pm); gtk_clist_set_sort_column(clist, column); } - gtk_clist_thaw(clist); gtk_clist_sort(clist); + + gtk_clist_thaw(clist); + } @@ -1007,8 +1007,6 @@ draw_ett_table_addresses(endpoints_table *et) } - -/* XXX should freeze/thaw table here and in the srt thingy? */ static void draw_ett_table_data(endpoints_table *et) { @@ -1016,6 +1014,9 @@ draw_ett_table_data(endpoints_table *et) int j; char title[256]; + /* Freeze the Endpoint table since quite a few changes will occur */ + gtk_clist_freeze(et->table); + if (et->page_lb) { if(et->num_endpoints) { g_snprintf(title, 255, "%s: %u", et->name, et->num_endpoints); @@ -1053,6 +1054,8 @@ draw_ett_table_data(endpoints_table *et) /* update table, so resolved addresses will be shown now */ draw_ett_table_addresses(et); + + gtk_clist_thaw(et->table); } @@ -1484,6 +1487,8 @@ add_ett_table_data(endpoints_table *et, address *src, address *dst, guint32 src_ char *entries[NUM_COLS]; char frames[16],bytes[16],txframes[16],txbytes[16],rxframes[16],rxbytes[16]; + /* Freeze the endpoint table while performing updates */ + gtk_clist_freeze(et->table); /* these values will be filled by call to draw_ett_table_addresses() below */ entries[0] = ""; @@ -1509,7 +1514,7 @@ add_ett_table_data(endpoints_table *et, address *src, address *dst, guint32 src_ gtk_clist_insert(et->table, talker_idx, entries); gtk_clist_set_row_data(et->table, talker_idx, (gpointer) talker_idx); - draw_ett_table_addresses(et); + gtk_clist_thaw(et->table); } } diff --git a/gtk/hostlist_table.c b/gtk/hostlist_table.c index 02b043f0b1..dd6b0e997d 100644 --- a/gtk/hostlist_table.c +++ b/gtk/hostlist_table.c @@ -2,7 +2,7 @@ * modified from endpoint_talkers_table.c 2003 Ronnie Sahlberg * Helper routines common to all host list taps. * - * $Id: hostlist_table.c,v 1.18 2004/07/10 11:53:51 ulfl Exp $ + * $Id: hostlist_table.c,v 1.19 2004/07/13 18:14:00 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -156,9 +156,7 @@ reset_hostlist_table_data(hostlist_table *hosts) } /* remove all entries from the clist */ - for(i=0;i<hosts->num_hosts;i++){ - gtk_clist_remove(hosts->table, hosts->num_hosts-i-1); - } + gtk_clist_clear(hosts->table); /* delete all hosts */ for(i=0;i<hosts->num_hosts;i++){ @@ -243,9 +241,10 @@ hostlist_click_column_cb(GtkCList *clist, gint column, gpointer data) gtk_widget_show(col_arrows[column].descend_pm); gtk_clist_set_sort_column(clist, column); } - gtk_clist_thaw(clist); gtk_clist_sort(clist); + + gtk_clist_thaw(clist); } @@ -493,7 +492,6 @@ draw_hostlist_table_addresses(hostlist_table *hl) } -/* XXX should freeze/thaw table here and in the srt thingy? */ static void draw_hostlist_table_data(hostlist_table *hl) { @@ -501,6 +499,9 @@ draw_hostlist_table_data(hostlist_table *hl) int j; char title[256]; + /* Freeze the Hostlist since quite a few changes will occur */ + gtk_clist_freeze(hl->table); + if (hl->page_lb) { if(hl->num_hosts) { g_snprintf(title, 255, "%s: %u", hl->name, hl->num_hosts); @@ -538,6 +539,8 @@ draw_hostlist_table_data(hostlist_table *hl) /* update table, so resolved addresses will be shown now */ draw_hostlist_table_addresses(hl); + + gtk_clist_thaw(hl->table); } static gboolean @@ -934,6 +937,9 @@ add_hostlist_table_data(hostlist_table *hl, address *addr, guint32 port, gboolea char frames[16],bytes[16],txframes[16],txbytes[16],rxframes[16],rxbytes[16]; + /* Freeze the hostlist while performing updates */ + gtk_clist_freeze(hl->table); + /* these values will be filled by call to draw_hostlist_table_addresses() below */ entries[0]=""; entries[1]=""; @@ -956,7 +962,7 @@ add_hostlist_table_data(hostlist_table *hl, address *addr, guint32 port, gboolea gtk_clist_insert(hl->table, talker_idx, entries); gtk_clist_set_row_data(hl->table, talker_idx, (gpointer) talker_idx); - draw_hostlist_table_addresses(hl); + gtk_clist_thaw(hl->table); } } |