[evolution] Reimplement e_table_specification_load_from_file().



commit 0af0c8427e740f8f16e8da3d81b6465b2163a719
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jun 30 13:11:55 2013 -0400

    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 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/e-util/e-table-specification.c b/e-util/e-table-specification.c
index ff02d3b..5554aaa 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;
 }
 


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