aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-28 22:11:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-02 22:34:10 +0800
commitad5ed0d603b0b915865bef3c4edc996378696187 (patch)
tree828eca186260e34b8f9c106b46519981437bdbd4 /mail
parentce3e2091c2ff7a581bfa959d71050a059d48ee94 (diff)
downloadgsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar.gz
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar.bz2
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar.lz
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar.xz
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.tar.zst
gsoc2013-evolution-ad5ed0d603b0b915865bef3c4edc996378696187.zip
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.
Diffstat (limited to 'mail')
-rw-r--r--mail/message-list.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 7ce74121a1..cf8f99ecc1 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -5053,7 +5053,7 @@ message_list_set_search (MessageList *message_list,
struct sort_column_data {
ETableCol *col;
- gboolean ascending;
+ GtkSortType sort_type;
};
struct sort_message_info_data {
@@ -5128,7 +5128,7 @@ cmp_array_uids (gconstpointer a,
res = v1 == NULL ? -1 : 1;
}
- if (!scol->ascending)
+ if (scol->sort_type == GTK_SORT_DESCENDING)
res = res * (-1);
}
@@ -5198,15 +5198,19 @@ ml_sort_uids_by_tree (MessageList *message_list,
i < len
&& !g_cancellable_is_cancelled (cancellable);
i++) {
- ETableSortColumn scol;
- struct sort_column_data *data = g_new0 (struct sort_column_data, 1);
+ ETableColumnSpecification *spec;
+ struct sort_column_data *data;
- scol = e_table_sort_info_sorting_get_nth (sort_info, i);
+ data = g_new0 (struct sort_column_data, 1);
- data->ascending = scol.ascending;
- data->col = e_table_header_get_column_by_col_idx (full_header, scol.column);
- if (data->col == NULL)
- data->col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
+ spec = e_table_sort_info_sorting_get_nth (
+ sort_info, i, &data->sort_type);
+
+ data->col = e_table_header_get_column_by_spec (full_header, spec);
+ if (data->col == NULL) {
+ gint last = e_table_header_count (full_header) - 1;
+ data->col = e_table_header_get_column (full_header, last);
+ }
g_ptr_array_add (sort_data.sort_columns, data);
}