aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-02 02:16:11 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-02 22:34:12 +0800
commitb5f6b03fdfe570085de542d81ddba7338723f9ac (patch)
tree2c1c99a24babc8419c2d67f9cad2a75b5a689c65
parenta5f7b4eef62959ededefbcb2e030f4801db74041 (diff)
downloadgsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar.gz
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar.bz2
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar.lz
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar.xz
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.tar.zst
gsoc2013-evolution-b5f6b03fdfe570085de542d81ddba7338723f9ac.zip
Remove e_table_specification_load_from_string().
No longer used outside of e-table-specification.c. Its logic is merged into e_table_specification_load_from_file(), but that too will be removed momentarily.
-rw-r--r--doc/reference/evolution-util/evolution-util-sections.txt1
-rw-r--r--e-util/e-table-specification.c40
-rw-r--r--e-util/e-table-specification.h3
3 files changed, 7 insertions, 37 deletions
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt b/doc/reference/evolution-util/evolution-util-sections.txt
index 15e629cca7..35f32d58d6 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3879,7 +3879,6 @@ e_table_specification_new
e_table_specification_ref_columns
e_table_specification_get_column_index
e_table_specification_load_from_file
-e_table_specification_load_from_string
<SUBSECTION Standard>
E_TABLE_SPECIFICATION
E_IS_TABLE_SPECIFICATION
diff --git a/e-util/e-table-specification.c b/e-util/e-table-specification.c
index 381504ecd6..348912acc5 100644
--- a/e-util/e-table-specification.c
+++ b/e-util/e-table-specification.c
@@ -554,46 +554,18 @@ gboolean
e_table_specification_load_from_file (ETableSpecification *specification,
const gchar *filename)
{
+ GMarkupParseContext *context;
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);
- if (g_file_get_contents (filename, &contents, NULL, NULL)) {
- success = e_table_specification_load_from_string (
- specification, contents);
- g_free (contents);
- contents = NULL;
+ if (!g_file_get_contents (filename, &contents, NULL, NULL)) {
+ g_warn_if_fail (contents == NULL);
+ return FALSE;
}
- g_warn_if_fail (contents == NULL);
-
- return success;
-}
-
-/**
- * e_table_specification_load_from_string:
- * @specification: an #ETableSpecification
- * @xml: a string containing an #ETable specification
- *
- * Parses the contents of @xml and configures @specification.
- *
- * @xml is typically returned by e_table_specification_save_to_string()
- * or it can be embedded in your source code.
- *
- * Returns: %TRUE on success, %FALSE on failure
- */
-gboolean
-e_table_specification_load_from_string (ETableSpecification *specification,
- const gchar *xml)
-{
- GMarkupParseContext *context;
- gboolean success = FALSE;
-
- g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), FALSE);
- g_return_val_if_fail (xml != NULL, FALSE);
-
g_ptr_array_set_size (specification->priv->columns, 0);
g_clear_object (&specification->state);
@@ -602,7 +574,7 @@ e_table_specification_load_from_string (ETableSpecification *specification,
g_object_ref (specification),
(GDestroyNotify) g_object_unref);
- if (g_markup_parse_context_parse (context, xml, -1, NULL))
+ if (g_markup_parse_context_parse (context, contents, -1, NULL))
success = g_markup_parse_context_end_parse (context, NULL);
g_markup_parse_context_free (context);
@@ -614,6 +586,8 @@ e_table_specification_load_from_string (ETableSpecification *specification,
specification->state->sort_info,
specification->allow_grouping);
+ g_free (contents);
+
return success;
}
diff --git a/e-util/e-table-specification.h b/e-util/e-table-specification.h
index 5abd0618a8..ff8ad062da 100644
--- a/e-util/e-table-specification.h
+++ b/e-util/e-table-specification.h
@@ -91,9 +91,6 @@ gint e_table_specification_get_column_index
gboolean e_table_specification_load_from_file
(ETableSpecification *specification,
const gchar *filename);
-gboolean e_table_specification_load_from_string
- (ETableSpecification *specification,
- const gchar *xml);
G_END_DECLS