diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-07-01 01:11:55 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-07-02 22:34:10 +0800 |
commit | 0af0c8427e740f8f16e8da3d81b6465b2163a719 (patch) | |
tree | 46e91f2683a75eae19b3fef4934d23b07e3b69f6 | |
parent | c337e2af1880b2833b8bd7180c02eac192f9d86b (diff) | |
download | gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar.gz gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar.bz2 gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar.lz gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar.xz gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.tar.zst gsoc2013-evolution-0af0c8427e740f8f16e8da3d81b6465b2163a719.zip |
Reimplement e_table_specification_load_from_file().
Use g_file_get_contents() and e_table_specification_load_from_string().
-rw-r--r-- | 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 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; } |