aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-03-17 20:55:53 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-03-17 20:55:53 +0800
commit6e28ab6523e9b07a724f8b5499aa9123bc51a772 (patch)
tree49fe46900e7ab121a175293ab1a905ffdc31b474 /mail/em-folder-tree-model.c
parenta88b08167972a93541a6820ff8a0dcfd6c4aecdb (diff)
downloadgsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.gz
gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.zst
gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.zip
** Fix for bug #514744
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. svn path=/trunk/; revision=35209
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c10
1 files changed, 8 insertions, 2 deletions
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");