From f267827d67d3fd11478fbf94da9cd6095400a49c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Jul 2013 09:22:18 -0400 Subject: 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() --- modules/mail/e-mail-shell-view-private.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/mail') diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 61cfd8b7ac..7779236e9e 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -545,22 +545,26 @@ mail_shell_view_load_view_collection (EShellViewClass *shell_view_class) ETableSpecification *spec; const gchar *base_dir; gchar *filename; + GError *local_error = NULL; collection = shell_view_class->view_collection; base_dir = EVOLUTION_ETSPECDIR; - spec = e_table_specification_new (); filename = g_build_filename (base_dir, ETSPEC_FILENAME, NULL); - if (!e_table_specification_load_from_file (spec, filename)) - g_critical ( - "Unable to load ETable specification file " - "for mail"); - g_free (filename); + spec = e_table_specification_new (filename, &local_error); + + /* Failure here is fatal. */ + if (local_error != NULL) { + g_error ("%s: %s", filename, local_error->message); + g_assert_not_reached (); + } factory = gal_view_factory_etable_new (spec); gal_view_collection_add_factory (collection, factory); g_object_unref (factory); + g_object_unref (spec); + g_free (filename); gal_view_collection_load (collection); } -- cgit v1.2.3