[evolution] Remove e_table_new_from_spec_file().



commit aeefcadc778590ae8e1a7d0ae704fb5adf809815
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 1 13:48:58 2013 -0400

    Remove e_table_new_from_spec_file().
    
    Also remove e_table_construct_from_spec_file().
    
    Use e_table_new() or e_table_construct() instead.

 addressbook/gui/widgets/e-addressbook-view.c       |    8 ++-
 calendar/gui/e-cal-list-view.c                     |    9 ++-
 calendar/gui/e-memo-table.c                        |    8 ++-
 calendar/gui/e-task-table.c                        |    8 ++-
 .../evolution-util/evolution-util-sections.txt     |    2 -
 e-util/e-table.c                                   |   77 --------------------
 e-util/e-table.h                                   |   10 ---
 7 files changed, 26 insertions(+), 96 deletions(-)
---
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 33999ef..1bbbe04 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -288,6 +288,7 @@ addressbook_view_create_table_view (EAddressbookView *view,
 {
        ETableModel *adapter;
        ETableExtras *extras;
+       ETableSpecification *specification;
        ECell *cell;
        GtkWidget *widget;
        gchar *etspecfile;
@@ -305,8 +306,13 @@ addressbook_view_create_table_view (EAddressbookView *view,
         * initial layout.  It does the rest.  */
        etspecfile = g_build_filename (
                EVOLUTION_ETSPECDIR, "e-addressbook-view.etspec", NULL);
-       widget = e_table_new_from_spec_file (adapter, extras, etspecfile);
+       specification = e_table_specification_new ();
+       e_table_specification_load_from_file (specification, etspecfile);
+
+       widget = e_table_new (adapter, extras, specification);
        gtk_container_add (GTK_CONTAINER (view), widget);
+
+       g_object_unref (specification);
        g_free (etspecfile);
 
        view->priv->object = G_OBJECT (adapter);
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
index 5150ac9..1a0f2ee 100644
--- a/calendar/gui/e-cal-list-view.c
+++ b/calendar/gui/e-cal-list-view.c
@@ -190,6 +190,7 @@ setup_e_table (ECalListView *cal_list_view)
 {
        ECalModel *model;
        ETableExtras *extras;
+       ETableSpecification *specification;
        GList *strings;
        ECell *cell, *popup_cell;
        GnomeCanvas *canvas;
@@ -310,11 +311,15 @@ setup_e_table (ECalListView *cal_list_view)
 
        etspecfile = g_build_filename (
                EVOLUTION_ETSPECDIR, "e-cal-list-view.etspec", NULL);
-       widget = e_table_new_from_spec_file (
-               E_TABLE_MODEL (model), extras, etspecfile);
+       specification = e_table_specification_new ();
+       e_table_specification_load_from_file (specification, etspecfile);
+
+       widget = e_table_new (E_TABLE_MODEL (model), extras, specification);
        gtk_container_add (GTK_CONTAINER (container), widget);
        cal_list_view->table = E_TABLE (widget);
        gtk_widget_show (widget);
+
+       g_object_unref (specification);
        g_free (etspecfile);
 
        /* Make sure text is readable on top of our color coding */
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index 4f1a59b..7537dc8 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -329,6 +329,7 @@ memo_table_constructed (GObject *object)
        ECalModel *model;
        ECell *cell, *popup_cell;
        ETableExtras *extras;
+       ETableSpecification *specification;
        AtkObject *a11y;
        gchar *etspecfile;
 
@@ -407,10 +408,13 @@ memo_table_constructed (GObject *object)
 
        etspecfile = g_build_filename (
                EVOLUTION_ETSPECDIR, "e-memo-table.etspec", NULL);
-       e_table_construct_from_spec_file (
+       specification = e_table_specification_new ();
+       e_table_specification_load_from_file (specification, etspecfile);
+       e_table_construct (
                E_TABLE (memo_table),
                E_TABLE_MODEL (model),
-               extras, etspecfile);
+               extras, specification);
+       g_object_unref (specification);
        g_free (etspecfile);
 
        gtk_widget_set_has_tooltip (GTK_WIDGET (memo_table), TRUE);
diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c
index 7672835..e0e817e 100644
--- a/calendar/gui/e-task-table.c
+++ b/calendar/gui/e-task-table.c
@@ -455,6 +455,7 @@ task_table_constructed (GObject *object)
        ECalModel *model;
        ECell *cell, *popup_cell;
        ETableExtras *extras;
+       ETableSpecification *specification;
        GList *strings;
        AtkObject *a11y;
        gchar *etspecfile;
@@ -694,10 +695,13 @@ task_table_constructed (GObject *object)
 
        etspecfile = g_build_filename (
                EVOLUTION_ETSPECDIR, "e-calendar-table.etspec", NULL);
-       e_table_construct_from_spec_file (
+       specification = e_table_specification_new ();
+       e_table_specification_load_from_file (specification, etspecfile);
+       e_table_construct (
                E_TABLE (task_table),
                E_TABLE_MODEL (model),
-               extras, etspecfile);
+               extras, specification);
+       g_object_unref (specification);
        g_free (etspecfile);
 
        gtk_widget_set_has_tooltip (GTK_WIDGET (task_table), TRUE);
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt 
b/doc/reference/evolution-util/evolution-util-sections.txt
index fd11aad..79ab655 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3314,8 +3314,6 @@ ETableCursorLoc
 ETable
 e_table_construct
 e_table_new
-e_table_construct_from_spec_file
-e_table_new_from_spec_file
 e_table_get_state
 e_table_save_state
 e_table_get_state_object
diff --git a/e-util/e-table.c b/e-util/e-table.c
index 43f47ae..10ddf63 100644
--- a/e-util/e-table.c
+++ b/e-util/e-table.c
@@ -1935,50 +1935,6 @@ e_table_construct (ETable *e_table,
 }
 
 /**
- * e_table_construct_from_spec_file:
- * @e_table: The newly created #ETable object.
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras.  (%NULL is valid.)
- * @spec_fn: The filename of the spec.
- *
- * This is the internal implementation of e_table_new_from_spec_file()
- * for use by subclasses or language bindings.  See
- * e_table_new_from_spec_file() for details.
- *
- * Return value:
- * The passed in value @e_table or %NULL if there's an error.
- **/
-ETable *
-e_table_construct_from_spec_file (ETable *e_table,
-                                  ETableModel *etm,
-                                  ETableExtras *ete,
-                                  const gchar *spec_fn)
-{
-       ETableSpecification *specification;
-       ETableState *state;
-
-       g_return_val_if_fail (E_IS_TABLE (e_table), NULL);
-       g_return_val_if_fail (E_IS_TABLE_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);
-
-       specification = e_table_specification_new ();
-       if (!e_table_specification_load_from_file (specification, spec_fn)) {
-               g_object_unref (specification);
-               return NULL;
-       }
-
-       state = g_object_ref (specification->state);
-
-       e_table = et_real_construct (e_table, etm, ete, specification, state);
-
-       e_table->spec = specification;
-       g_object_unref (state);
-
-       return e_table;
-}
-
-/**
  * e_table_new:
  * @etm: The model for this table.
  * @ete: An optional #ETableExtras.  (%NULL is valid.)
@@ -2016,39 +1972,6 @@ e_table_new (ETableModel *etm,
 }
 
 /**
- * e_table_new_from_spec_file:
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras.  (%NULL is valid.)
- * @spec_fn: The filename of the spec.
- *
- * This is very similar to e_table_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_table_new_from_spec_file will return %NULL.
- *
- * Return value:
- * The newly created #ETable or %NULL if there's an error.
- **/
-GtkWidget *
-e_table_new_from_spec_file (ETableModel *etm,
-                            ETableExtras *ete,
-                            const gchar *spec_fn)
-{
-       ETable *e_table;
-
-       g_return_val_if_fail (E_IS_TABLE_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);
-
-       e_table = g_object_new (E_TYPE_TABLE, NULL);
-
-       e_table = e_table_construct_from_spec_file (e_table, etm, ete, spec_fn);
-
-       return GTK_WIDGET (e_table);
-}
-
-/**
  * e_table_set_cursor_row:
  * @e_table: The #ETable to set the cursor row of
  * @row: The row number
diff --git a/e-util/e-table.h b/e-util/e-table.h
index 1f2eb36..ee0d553 100644
--- a/e-util/e-table.h
+++ b/e-util/e-table.h
@@ -275,16 +275,6 @@ GtkWidget *        e_table_new                     (ETableModel *etm,
                                                 ETableExtras *ete,
                                                 ETableSpecification *specification);
 
-/* Create an ETable using files. */
-ETable *       e_table_construct_from_spec_file
-                                               (ETable *e_table,
-                                                ETableModel *etm,
-                                                ETableExtras *ete,
-                                                const gchar *spec_fn);
-GtkWidget *    e_table_new_from_spec_file      (ETableModel *etm,
-                                                ETableExtras *ete,
-                                                const gchar *spec_fn);
-
 /* To save the state */
 gchar *                e_table_get_state               (ETable *e_table);
 void           e_table_save_state              (ETable *e_table,


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