aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-folder-tree-model.c10
2 files changed, 15 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 85cd57d9e5..185ac5d149 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-17 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #514744
+
+ * em-folder-tree-model.c: (em_folder_tree_model_load_state):
+ Check also for proper root node and use default if not the right one.
+
2008-03-13 Milan Crha <mcrha@redhat.com>
* em-folder-tree.c:
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 7d174e8fbc..b0a5206d7f 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -339,8 +339,14 @@ em_folder_tree_model_load_state (EMFolderTreeModel *model, const char *filename)
if (model->state)
xmlFreeDoc (model->state);
- if ((model->state = e_xml_parse_file (filename)))
- return;
+ if ((model->state = e_xml_parse_file (filename)) != NULL) {
+ node = xmlDocGetRootElement (model->state);
+ if (!node || strcmp ((char *)node->name, "tree-state") != 0) {
+ /* it is not expected XML file, thus free it and use the default */
+ xmlFreeDoc (model->state);
+ } else
+ return;
+ }
/* setup some defaults - expand "Local Folders" and "Search Folders" */
model->state = xmlNewDoc ((const unsigned char *)"1.0");