[gtranslator] translation-memory: add error if database cannot be created.



commit dd69d6b8f5e29c187bb22aaf650b45da82965f8c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Apr 5 11:35:16 2012 +0200

    translation-memory: add error if database cannot be created.
    
    The right fix would be to implement the initable interface and
    move all the initialization of the database there.

 plugins/translation-memory/gda/gtr-gda.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/plugins/translation-memory/gda/gtr-gda.c b/plugins/translation-memory/gda/gtr-gda.c
index 18d5585..24415ab 100644
--- a/plugins/translation-memory/gda/gtr-gda.c
+++ b/plugins/translation-memory/gda/gtr-gda.c
@@ -739,6 +739,7 @@ static void
 gtr_gda_init (GtrGda * self)
 {
   gchar *connection_string;
+  GError *error = NULL;
 
   self->priv = GTR_GDA_GET_PRIVATE (self);
 
@@ -762,7 +763,12 @@ gtr_gda_init (GtrGda * self)
                                                     connection_string,
                                                     NULL,
                                                     GDA_CONNECTION_OPTIONS_NONE,
-                                                    NULL);
+                                                    &error);
+  if (error)
+    {
+      g_warning ("Error creating database: %s", error->message);
+      g_error_free (error);
+    }
 
   gda_connection_execute_non_select_command (self->priv->db,
                                              "create table WORD ("



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