Remove e_tree_new_from_spec_file().

Also remove e_tree_construct_from_spec_file().

Use e_tree_new() or e_tree_construct() instead.
This commit is contained in:
Matthew Barnes
2013-07-01 14:12:18 -04:00
parent aeefcadc77
commit a5f7b4eef6
4 changed files with 8 additions and 99 deletions

View File

@ -4113,8 +4113,6 @@ ETimezoneDialogPrivate
ETree
e_tree_construct
e_tree_new
e_tree_construct_from_spec_file
e_tree_new_from_spec_file
e_tree_get_state
e_tree_get_state_object
e_tree_get_spec

View File

@ -1663,55 +1663,6 @@ e_tree_construct (ETree *tree,
return TRUE;
}
/**
* e_tree_construct_from_spec_file:
* @tree: The newly created #ETree object.
* @etm: The model for this tree
* @ete: An optional #ETableExtras (%NULL is valid.)
* @spec_fn: The filename of the spec
*
* This is the internal implementation of e_tree_new_from_spec_file()
* for use by subclasses or language bindings. See
* e_tree_new_from_spec_file() for details.
*
* Return value: %TRUE on success, %FALSE if an error occurred
**/
gboolean
e_tree_construct_from_spec_file (ETree *tree,
ETreeModel *etm,
ETableExtras *ete,
const gchar *spec_fn)
{
ETableSpecification *specification;
ETableState *state;
g_return_val_if_fail (E_IS_TREE (tree), FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etm), FALSE);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), FALSE);
g_return_val_if_fail (spec_fn != NULL, FALSE);
specification = e_table_specification_new ();
if (!e_table_specification_load_from_file (specification, spec_fn)) {
g_object_unref (specification);
return FALSE;
}
state = g_object_ref (specification->state);
if (!et_real_construct (tree, etm, ete, specification, state)) {
g_object_unref (specification);
g_object_unref (state);
return FALSE;
}
tree->priv->spec = specification;
tree->priv->spec->allow_grouping = FALSE;
g_object_unref (state);
return TRUE;
}
/**
* e_tree_new:
* @etm: The model for this tree
@ -1752,42 +1703,6 @@ e_tree_new (ETreeModel *etm,
return GTK_WIDGET (tree);
}
/**
* e_tree_new_from_spec_file:
* @etm: The model for this tree.
* @ete: An optional #ETableExtras. (%NULL is valid.)
* @spec_fn: The filename of the spec.
*
* This is very similar to e_tree_new(), except instead of passing in
* strings you pass in the file names of the spec and state to load.
*
* @spec_fn is the filename of the spec to load. If this file doesn't
* exist, e_tree_new_from_spec_file will return %NULL.
*
* Return value:
* The newly created #ETree or %NULL if there's an error.
**/
GtkWidget *
e_tree_new_from_spec_file (ETreeModel *etm,
ETableExtras *ete,
const gchar *spec_fn)
{
ETree *tree;
g_return_val_if_fail (E_IS_TREE_MODEL (etm), NULL);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL);
g_return_val_if_fail (spec_fn != NULL, NULL);
tree = g_object_new (E_TYPE_TREE, NULL);
if (!e_tree_construct_from_spec_file (tree, etm, ete, spec_fn)) {
g_object_unref (tree);
return NULL;
}
return (GtkWidget *) tree;
}
void
e_tree_show_cursor_after_reflow (ETree *tree)
{

View File

@ -180,15 +180,6 @@ GtkWidget * e_tree_new (ETreeModel *etm,
ETableExtras *ete,
ETableSpecification *specification);
/* Create an ETree using files. */
gboolean e_tree_construct_from_spec_file (ETree *tree,
ETreeModel *etm,
ETableExtras *ete,
const gchar *spec_fn);
GtkWidget * e_tree_new_from_spec_file (ETreeModel *etm,
ETableExtras *ete,
const gchar *spec_fn);
/* To save the state */
gchar * e_tree_get_state (ETree *tree);
ETableState * e_tree_get_state_object (ETree *tree);

View File

@ -3356,6 +3356,7 @@ static void
message_list_construct (MessageList *message_list)
{
ETreeTableAdapter *adapter;
ETableSpecification *specification;
AtkObject *a11y;
gboolean constructed;
gchar *etspecfile;
@ -3365,11 +3366,15 @@ message_list_construct (MessageList *message_list)
*/
message_list->extras = message_list_create_extras ();
etspecfile = g_build_filename (EVOLUTION_ETSPECDIR, "message-list.etspec", NULL);
constructed = e_tree_construct_from_spec_file (
etspecfile = g_build_filename (
EVOLUTION_ETSPECDIR, "message-list.etspec", NULL);
specification = e_table_specification_new ();
e_table_specification_load_from_file (specification, etspecfile);
constructed = e_tree_construct (
E_TREE (message_list),
E_TREE_MODEL (message_list),
message_list->extras, etspecfile);
message_list->extras, specification);
g_object_unref (specification);
g_free (etspecfile);
adapter = e_tree_get_table_adapter (E_TREE (message_list));