aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-27 11:59:06 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-02 22:34:09 +0800
commit10e8a60ee342c6d28bf0a63b387e5248c33affab (patch)
treeffd0e8b2e1b56bcc162aa46b7b91c6d1b36c05c4
parent6562ce11316558386b3288cd3725627d98743edf (diff)
downloadgsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar.gz
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar.bz2
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar.lz
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar.xz
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.tar.zst
gsoc2013-evolution-10e8a60ee342c6d28bf0a63b387e5248c33affab.zip
ETableSortInfo: Move "group_count" to private section.
Use e_table_sort_info_grouping_get_count() to obtain the value.
-rw-r--r--e-util/e-table-sort-info.c20
-rw-r--r--e-util/e-table-sort-info.h1
2 files changed, 11 insertions, 10 deletions
diff --git a/e-util/e-table-sort-info.c b/e-util/e-table-sort-info.c
index 54d5c8e8be..1f82ba91b7 100644
--- a/e-util/e-table-sort-info.c
+++ b/e-util/e-table-sort-info.c
@@ -29,6 +29,7 @@
struct _ETableSortInfoPrivate {
GWeakRef specification;
+ guint group_count;
gboolean can_group;
};
@@ -239,7 +240,7 @@ e_table_sort_info_grouping_get_count (ETableSortInfo *sort_info)
g_return_val_if_fail (E_IS_TABLE_SORT_INFO (sort_info), 0);
if (e_table_sort_info_get_can_group (sort_info))
- count = sort_info->group_count;
+ count = sort_info->priv->group_count;
return count;
}
@@ -248,14 +249,14 @@ static void
table_sort_info_grouping_real_truncate (ETableSortInfo *sort_info,
gint length)
{
- if (length < sort_info->group_count)
- sort_info->group_count = length;
+ if (length < sort_info->priv->group_count)
+ sort_info->priv->group_count = length;
- if (length > sort_info->group_count) {
+ if (length > sort_info->priv->group_count) {
sort_info->groupings = g_realloc (
sort_info->groupings,
length * sizeof (ETableSortColumn));
- sort_info->group_count = length;
+ sort_info->priv->group_count = length;
}
}
@@ -318,7 +319,7 @@ e_table_sort_info_grouping_set_nth (ETableSortInfo *sort_info,
{
g_return_if_fail (E_IS_TABLE_SORT_INFO (sort_info));
- if (n >= sort_info->group_count)
+ if (n >= sort_info->priv->group_count)
table_sort_info_grouping_real_truncate (sort_info, n + 1);
sort_info->groupings[n] = column;
@@ -540,12 +541,13 @@ e_table_sort_info_duplicate (ETableSortInfo *sort_info)
new_info = e_table_sort_info_new (specification);
g_object_unref (specification);
- new_info->group_count = sort_info->group_count;
- new_info->groupings = g_new (ETableSortColumn, new_info->group_count);
+ new_info->priv->group_count = sort_info->priv->group_count;
+ new_info->groupings = g_new (
+ ETableSortColumn, new_info->priv->group_count);
memmove (
new_info->groupings,
sort_info->groupings,
- sizeof (ETableSortColumn) * new_info->group_count);
+ sizeof (ETableSortColumn) * new_info->priv->group_count);
new_info->sort_count = sort_info->sort_count;
new_info->sortings = g_new (ETableSortColumn, new_info->sort_count);
diff --git a/e-util/e-table-sort-info.h b/e-util/e-table-sort-info.h
index d1de2d3f28..8c90be354e 100644
--- a/e-util/e-table-sort-info.h
+++ b/e-util/e-table-sort-info.h
@@ -65,7 +65,6 @@ struct _ETableSortInfo {
GObject parent;
ETableSortInfoPrivate *priv;
- gint group_count;
ETableSortColumn *groupings;
gint sort_count;
ETableSortColumn *sortings;