From 3f2384a8729d05203f0ce4d4dc9b3de236f9c18c Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 7 Sep 2001 18:53:35 +0000 Subject: Added this function. 2001-09-07 Christopher James Lahey * e-table-without.c, e-table-without.h (e_table_without_show_all): Added this function. svn path=/trunk/; revision=12677 --- widgets/table/e-table-without.c | 31 +++++++++++++++++++++++++++++-- widgets/table/e-table-without.h | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index db05b072d1..e14b8aca8b 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -309,8 +309,9 @@ void e_table_without_hide_adopt (ETableWithout *etw, } } -void e_table_without_show (ETableWithout *etw, - void *key) +void +e_table_without_show (ETableWithout *etw, + void *key) { int i; /* Model row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -332,3 +333,29 @@ void e_table_without_show (ETableWithout *etw, g_hash_table_remove (etw->priv->hash, key); } } + +void +e_table_without_show_all (ETableWithout *etw) +{ + int i; /* Model row */ + int row_count; + ETableSubset *etss = E_TABLE_SUBSET (etw); + + if (etw->priv->hash) { + g_hash_table_foreach (etw->priv->hash, delete_hash_element, etw); + g_hash_table_destroy (etw->priv->hash); + etw->priv->hash = NULL; + } + etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func); + + g_free (etss->map_table); + row_count = e_table_model_row_count (E_TABLE_MODEL(etw)); + etss->map_table = g_new (int, row_count); + + for (i = 0; i < row_count; i++) { + etss->map_table[i++] = i; + } + etss->n_map = i; + + e_table_model_changed (E_TABLE_MODEL (etw)); +} diff --git a/widgets/table/e-table-without.h b/widgets/table/e-table-without.h index 62dd718f28..9916719eb8 100644 --- a/widgets/table/e-table-without.h +++ b/widgets/table/e-table-without.h @@ -58,6 +58,7 @@ void e_table_without_hide_adopt (ETableWithout *etw, void *key); void e_table_without_show (ETableWithout *etw, void *key); +void e_table_without_show_all (ETableWithout *etw); #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3