aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-table-state.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-27 11:08:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-02 22:34:09 +0800
commit21998504a040f3c578a0e0478847cf95c50d6191 (patch)
treea874dcff0aae162a351216a26aab033291df1697 /e-util/e-table-state.c
parentcf33c28a0e0fab775856df4c268c40eb4b67fe8b (diff)
downloadgsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar.gz
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar.bz2
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar.lz
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar.xz
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.tar.zst
gsoc2013-evolution-21998504a040f3c578a0e0478847cf95c50d6191.zip
ETableSortInfo: Add a "specification" construct-only property.
ETableSortInfo now keeps a weak reference on the ETableSpecification to which it's associated. The plan is to replace the column index numbers with a direct reference to an ETableColumnSpecification from the spec. New functions: e_table_sort_info_ref_specification()
Diffstat (limited to 'e-util/e-table-state.c')
-rw-r--r--e-util/e-table-state.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/e-util/e-table-state.c b/e-util/e-table-state.c
index d37e7088c3..54416a42ba 100644
--- a/e-util/e-table-state.c
+++ b/e-util/e-table-state.c
@@ -123,9 +123,13 @@ static void
table_state_constructed (GObject *object)
{
ETableState *state;
+ ETableSpecification *specification;
state = E_TABLE_STATE (object);
- state->sort_info = e_table_sort_info_new ();
+
+ specification = e_table_state_ref_specification (state);
+ state->sort_info = e_table_sort_info_new (specification);
+ g_object_unref (specification);
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_table_state_parent_class)->constructed (object);
@@ -305,7 +309,8 @@ e_table_state_load_from_node (ETableState *state,
list = g_list_append (list, column_info);
} else if (state->sort_info == NULL &&
!strcmp ((gchar *) children->name, "grouping")) {
- state->sort_info = e_table_sort_info_new ();
+ state->sort_info =
+ e_table_sort_info_new (specification);
e_table_sort_info_load_from_node (
state->sort_info, children, state_version);
}
@@ -321,8 +326,8 @@ e_table_state_load_from_node (ETableState *state,
ETableColumnSpecification *, state->col_count);
state->expansions = g_new (double, state->col_count);
- if (!state->sort_info)
- state->sort_info = e_table_sort_info_new ();
+ if (state->sort_info == NULL)
+ state->sort_info = e_table_sort_info_new (specification);
e_table_sort_info_set_can_group (state->sort_info, can_group);
for (iterator = list, i = 0; iterator; i++) {