aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-02 21:22:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-02 22:34:12 +0800
commitf267827d67d3fd11478fbf94da9cd6095400a49c (patch)
tree29bf07f39ab001ea53bdb1bd67c32242e53c0944 /addressbook/gui
parentdfc653bb43a6311c04d7881c2d1b1642c081f839 (diff)
downloadgsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar.gz
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar.bz2
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar.lz
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar.xz
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.tar.zst
gsoc2013-evolution-f267827d67d3fd11478fbf94da9cd6095400a49c.zip
ETableSpecification: Implement GInitable.
e_table_specification_new() now takes a table specification filename and a GError and parses the file as part of instance creation. If a file or parse error occurs, e_table_specification_new() returns NULL. This replaces e_table_specification_load_from_file(). New functions: e_table_specification_get_filename() Removed functions: e_table_specification_load_from_file()
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 1bbbe04882..763ff87268 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -292,6 +292,7 @@ addressbook_view_create_table_view (EAddressbookView *view,
ECell *cell;
GtkWidget *widget;
gchar *etspecfile;
+ GError *local_error = NULL;
adapter = e_addressbook_table_adapter_new (view->priv->model);
@@ -301,14 +302,19 @@ addressbook_view_create_table_view (EAddressbookView *view,
cell = e_table_extras_get_cell (extras, "date");
e_cell_date_set_format_component (E_CELL_DATE (cell), "addressbook");
- /* Here we create the table. We give it the three pieces of
- * the table we've created, the header, the model, and the
- * initial layout. It does the rest. */
etspecfile = g_build_filename (
EVOLUTION_ETSPECDIR, "e-addressbook-view.etspec", NULL);
- specification = e_table_specification_new ();
- e_table_specification_load_from_file (specification, etspecfile);
+ specification = e_table_specification_new (etspecfile, &local_error);
+
+ /* Failure here is fatal. */
+ if (local_error != NULL) {
+ g_error ("%s: %s", etspecfile, local_error->message);
+ g_assert_not_reached ();
+ }
+ /* Here we create the table. We give it the three pieces of
+ * the table we've created, the header, the model, and the
+ * initial layout. It does the rest. */
widget = e_table_new (adapter, extras, specification);
gtk_container_add (GTK_CONTAINER (view), widget);