diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-05-16 12:23:41 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-05-16 12:23:41 +0800 |
commit | 80c82227611ca9856bf34ea470f712c12b2d5bae (patch) | |
tree | cdaa27cb6d7519aa264e273e311afabadef967c4 /widgets | |
parent | acf68b517a7736d9c2abe6512a8db8925802e97e (diff) | |
download | gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar.gz gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar.bz2 gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar.lz gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar.xz gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.tar.zst gsoc2013-evolution-80c82227611ca9856bf34ea470f712c12b2d5bae.zip |
Add code to support default thread expand state
svn path=/trunk/; revision=33550
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/table/e-tree-table-adapter.c | 21 |
2 files changed, 26 insertions, 1 deletions
diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog index 59b69fe6f5..206086aa1b 100644 --- a/widgets/table/ChangeLog +++ b/widgets/table/ChangeLog @@ -1,3 +1,9 @@ +2007-05-16 Srinivasa Ragavan <sragavan@novell.com> + + * e-tree-table-adapter.c: + (e_tree_table_adapter_load_expanded_state): Add support for retaining + default tree expand state + 2007-05-14 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #378441 from Ebby Wiselyn diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 212fbedf89..2d5f72b4e6 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -1020,6 +1020,7 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *f xmlDoc *doc; xmlNode *root, *child; gboolean model_default; + gboolean file_default = FALSE; g_return_if_fail(etta != NULL); @@ -1030,9 +1031,27 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *f root = xmlDocGetRootElement (doc); e_table_model_pre_change(E_TABLE_MODEL(etta)); - + model_default = e_tree_model_get_expanded_default(etta->priv->source); + if (!strcmp (root->name, "expanded_state")) { + char *state; + + state = e_xml_get_string_prop_by_name_with_default (root, "default", ""); + + if (state[0] == 't') + file_default = TRUE; + else + file_default = FALSE; /* Even unspecified we'll consider as false */ + } + + /* Incase the default is changed, lets forget the changes and stick to default */ + + if (file_default != model_default) { + xmlFreeDoc (doc); + return; + } + for (child = root->xmlChildrenNode; child; child = child->next) { char *id; ETreePath path; |