From ce3e2091c2ff7a581bfa959d71050a059d48ee94 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 28 Jun 2013 16:35:30 -0400 Subject: Add e_table_sort_info_sorting_remove(). --- e-util/e-table-sort-info.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'e-util/e-table-sort-info.c') diff --git a/e-util/e-table-sort-info.c b/e-util/e-table-sort-info.c index 3f1f928e74..047e31da6c 100644 --- a/e-util/e-table-sort-info.c +++ b/e-util/e-table-sort-info.c @@ -344,6 +344,25 @@ e_table_sort_info_sorting_get_count (ETableSortInfo *sort_info) return sort_info->priv->sortings->len; } +/** + * e_table_sort_info_sorting_remove: + * @sort_info: an #ETableSortInfo + * @n: the index of the element to remove + * + * Removes the sorting element at the given index. The following sorting + * elements are moved down one place. + **/ +void +e_table_sort_info_sorting_remove (ETableSortInfo *sort_info, + guint n) +{ + g_return_if_fail (E_IS_TABLE_SORT_INFO (sort_info)); + + g_array_remove_index (sort_info->priv->sortings, n); + + g_signal_emit (sort_info, signals[SORT_INFO_CHANGED], 0); +} + /** * e_table_sort_info_sorting_truncate: * @sort_info: an #ETableSortInfo -- cgit v1.2.3