evolution r35209 - trunk/mail



Author: mcrha
Date: Mon Mar 17 12:55:53 2008
New Revision: 35209
URL: http://svn.gnome.org/viewvc/evolution?rev=35209&view=rev

Log:
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.



Modified:
   trunk/mail/ChangeLog
   trunk/mail/em-folder-tree-model.c

Modified: trunk/mail/em-folder-tree-model.c
==============================================================================
--- trunk/mail/em-folder-tree-model.c	(original)
+++ trunk/mail/em-folder-tree-model.c	Mon Mar 17 12:55:53 2008
@@ -339,8 +339,14 @@
 	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");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]