diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-07-26 05:56:06 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-07-26 05:56:06 +0800 |
commit | 20e7e5d6502063bd4c05ffd35bc1657e6345ab94 (patch) | |
tree | 310629ee9a0dbfd56dd63394cbfb86e764fa93c2 /widgets/e-table/e-table-selection-model.c | |
parent | fe4bbe19bf2bd577edbb1e3aa17a4317be55b6ed (diff) | |
download | gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar.gz gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar.bz2 gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar.lz gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar.xz gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.tar.zst gsoc2013-evolution-20e7e5d6502063bd4c05ffd35bc1657e6345ab94.zip |
Replaced get_selection_list with foreach.
2000-07-25 Christopher James Lahey <clahey@helixcode.com>
* e-table-selection-model.c, e-table-selection-model.h: Replaced
get_selection_list with foreach.
* e-table.h: Add a ETableSelectionModel.
svn path=/trunk/; revision=4334
Diffstat (limited to 'widgets/e-table/e-table-selection-model.c')
-rw-r--r-- | widgets/e-table/e-table-selection-model.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/widgets/e-table/e-table-selection-model.c b/widgets/e-table/e-table-selection-model.c index 77be6eb2fa..6524dee4d4 100644 --- a/widgets/e-table/e-table-selection-model.c +++ b/widgets/e-table/e-table-selection-model.c @@ -196,7 +196,7 @@ e_table_selection_model_new (void) gboolean e_table_selection_model_is_row_selected (ETableSelectionModel *selection, - int n) + guint n) { if (selection->row_count < n) return 0; @@ -204,25 +204,22 @@ e_table_selection_model_is_row_selected (ETableSelectionModel *selection, return ((selection->selection[n / 32]) >> (31 - (n % 32))) & 0x1; } -GList * -e_table_selection_model_get_selection_list (ETableSelectionModel *selection) +void +e_table_selection_model_foreach (ETableSelectionModel *selection, + ETableForeachFunc callback, + gpointer closure) { int i; - GList *list = NULL; - if (selection->row_count < 0) - return NULL; for (i = selection->row_count / 32; i >= 0; i--) { if (selection->selection[i]) { int j; guint32 value = selection->selection[i]; for (j = 31; j >= 0; j--) { if (value & 0x1) { - list = g_list_prepend(list, (void *) (i * 32 + j)); + callback(i * 32 + j, closure); } value >>= 1; } } } - - return NULL; } |