Add e_table_sort_info_sorting_remove().
This commit is contained in:
@ -3878,6 +3878,7 @@ ETableSortColumn
|
||||
e_table_sort_info_grouping_get_nth
|
||||
e_table_sort_info_grouping_set_nth
|
||||
e_table_sort_info_sorting_get_count
|
||||
e_table_sort_info_sorting_remove
|
||||
e_table_sort_info_sorting_truncate
|
||||
e_table_sort_info_sorting_get_nth
|
||||
e_table_sort_info_sorting_set_nth
|
||||
|
||||
@ -1818,16 +1818,8 @@ ethi_change_sort_state (ETableHeaderItem *ethi,
|
||||
* This means the user has clicked twice
|
||||
* already, lets kill sorting of this column now.
|
||||
*/
|
||||
gint j;
|
||||
|
||||
for (j = i + 1; j < length; j++)
|
||||
e_table_sort_info_sorting_set_nth (
|
||||
ethi->sort_info, j - 1,
|
||||
e_table_sort_info_sorting_get_nth (
|
||||
ethi->sort_info, j));
|
||||
|
||||
e_table_sort_info_sorting_truncate (
|
||||
ethi->sort_info, length - 1);
|
||||
e_table_sort_info_sorting_remove (
|
||||
ethi->sort_info, i);
|
||||
length--;
|
||||
i--;
|
||||
} else {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -98,6 +98,9 @@ void e_table_sort_info_grouping_set_nth
|
||||
|
||||
guint e_table_sort_info_sorting_get_count
|
||||
(ETableSortInfo *sort_info);
|
||||
void e_table_sort_info_sorting_remove
|
||||
(ETableSortInfo *sort_info,
|
||||
guint n);
|
||||
void e_table_sort_info_sorting_truncate
|
||||
(ETableSortInfo *sort_info,
|
||||
guint length);
|
||||
|
||||
Reference in New Issue
Block a user