aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/ChangeLog6
-rw-r--r--widgets/table/e-tree-table-adapter.c21
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;