From 0af0c8427e740f8f16e8da3d81b6465b2163a719 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Sun, 30 Jun 2013 13:11:55 -0400
Subject: Reimplement e_table_specification_load_from_file().

Use g_file_get_contents() and e_table_specification_load_from_string().
---
 e-util/e-table-specification.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'e-util/e-table-specification.c')

diff --git a/e-util/e-table-specification.c b/e-util/e-table-specification.c
index ff02d3b08e..5554aaa043 100644
--- a/e-util/e-table-specification.c
+++ b/e-util/e-table-specification.c
@@ -558,20 +558,21 @@ gboolean
 e_table_specification_load_from_file (ETableSpecification *specification,
                                       const gchar *filename)
 {
-	xmlDoc *doc;
+	gchar *contents = NULL;
 	gboolean success = FALSE;
 
 	g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), FALSE);
 	g_return_val_if_fail (filename != NULL, FALSE);
 
-	doc = e_xml_parse_file (filename);
-	if (doc != NULL) {
-		xmlNode *node = xmlDocGetRootElement (doc);
-		e_table_specification_load_from_node (specification, node);
-		xmlFreeDoc (doc);
-		success = TRUE;
+	if (g_file_get_contents (filename, &contents, NULL, NULL)) {
+		success = e_table_specification_load_from_string (
+			specification, contents);
+		g_free (contents);
+		contents = NULL;
 	}
 
+	g_warn_if_fail (contents == NULL);
+
 	return success;
 }
 
-- 
cgit v1.2.3