From ad5ed0d603b0b915865bef3c4edc996378696187 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 28 Jun 2013 10:11:21 -0400 Subject: ETableSortInfo: Rework API to avoid exposing ETableSortColumn. Replace ETableSortColumn with separate ETableColumnSpecification and GtkSortType parameters in the "get_nth" and "set_nth" functions. Makes some other parts of the code simpler since it no longer has to translate a column number to a column specification. --- e-util/e-table-group-container.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'e-util/e-table-group-container.c') diff --git a/e-util/e-table-group-container.c b/e-util/e-table-group-container.c index 68239b123f..d828ddec3e 100644 --- a/e-util/e-table-group-container.c +++ b/e-util/e-table-group-container.c @@ -150,12 +150,15 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableSortInfo *sort_info, gint n) { + ETableColumnSpecification *spec; ETableCol *col; - ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, n); GtkWidget *widget; GtkStyle *style; + GtkSortType sort_type; + + spec = e_table_sort_info_grouping_get_nth (sort_info, n, &sort_type); + col = e_table_header_get_column_by_spec (full_header, spec); - col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) { gint last = e_table_header_count (full_header) - 1; col = e_table_header_get_column (full_header, last); @@ -166,7 +169,7 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, etgc->ecol = g_object_ref (col); etgc->sort_info = g_object_ref (sort_info); etgc->n = n; - etgc->ascending = column.ascending; + etgc->ascending = (sort_type == GTK_SORT_ASCENDING); widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas); style = gtk_widget_get_style (widget); -- cgit v1.2.3