diff options
author | Milan Crha <mcrha@redhat.com> | 2008-03-17 20:55:53 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-03-17 20:55:53 +0800 |
commit | 6e28ab6523e9b07a724f8b5499aa9123bc51a772 (patch) | |
tree | 49fe46900e7ab121a175293ab1a905ffdc31b474 | |
parent | a88b08167972a93541a6820ff8a0dcfd6c4aecdb (diff) | |
download | gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.gz gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.bz2 gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.lz gsoc2013-evolution-6e28ab6523e9b07a724f8b5499aa9123bc51a772.tar.xz 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
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 10 |
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"); |