[gtranslator] Add support for libgda-5.0 (Dominique Leuenberger).



commit 23516385bd647ab46e9ee0d1653262682ea68049
Author: Jordi Mallach <jordi sindominio net>
Date:   Thu Jan 5 16:04:25 2012 +0100

    Add support for libgda-5.0 (Dominique Leuenberger).
    
    Replace uses of deprecated gda_execute_non_select_command with
    gda_connection_execute_non_select_command. Bump LIBGDA requirement
    to 4.2.3.
    
    Add new configure option --with-gda=4.0|5.0, defaulting to 4.0.

 configure.ac                         |    8 +++-
 src/translation-memory/gda/gtr-gda.c |   64 +++++++++++++++++-----------------
 2 files changed, 38 insertions(+), 34 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 56a8da3..c027a9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,12 +81,16 @@ GLIB_REQUIRED=2.28.0
 LIBXML_REQUIRED=2.4.12
 SOURCEVIEW_REQUIRED=3.0.0
 GDL_REQUIRED=2.91.1
-GDA_REQUIRED=4.2.0
+GDA_REQUIRED=4.2.3
 PEAS_REQUIRED=1.0.0
 GDICT_OPTIONAL=0.11.0
 GTKSPELL_OPTIONAL=2.99.99
 JSON_GLIB_OPTIONAL=0.12.0
 
+AC_ARG_WITH(gda,
+	AS_HELP_STRING([--with-gda={4.0|5.0}],[Define which version of libgda to use]),,
+	with_gda=4.0)
+
 PKG_CHECK_MODULES(GTRANSLATOR, [
 	libxml-2.0 >= $LIBXML_REQUIRED
 	gthread-2.0 >= $GTHREAD_REQUIRED
@@ -96,7 +100,7 @@ PKG_CHECK_MODULES(GTRANSLATOR, [
 	gtksourceview-3.0 >= $SOURCEVIEW_REQUIRED
 	gdl-3.0 >= $GDL_REQUIRED
 	gsettings-desktop-schemas
-	libgda-4.0 >= $GDA_REQUIRED
+	libgda-$with_gda >= $GDA_REQUIRED
 	libpeas-1.0 >= $PEAS_REQUIRED
 	libpeas-gtk-1.0 >= $PEAS_REQUIRED
 ])
diff --git a/src/translation-memory/gda/gtr-gda.c b/src/translation-memory/gda/gtr-gda.c
index 009662f..9b5ec31 100644
--- a/src/translation-memory/gda/gtr-gda.c
+++ b/src/translation-memory/gda/gtr-gda.c
@@ -764,38 +764,38 @@ gtr_gda_init (GtrGda * self)
                                                     GDA_CONNECTION_OPTIONS_NONE,
                                                     NULL);
 
-  gda_execute_non_select_command (self->priv->db,
-                                  "create table WORD ("
-                                  "ID integer primary key autoincrement,"
-                                  "VALUE text unique)",
-                                  NULL);
-
-  gda_execute_non_select_command (self->priv->db,
-                                  "create table WORD_ORIG_LINK ("
-                                  "WORD_ID integer,"
-                                  "ORIG_ID integer,"
-                                  "primary key (WORD_ID, ORIG_ID))",
-                                  NULL);
-
-  gda_execute_non_select_command (self->priv->db,
-                                  "create table ORIG ("
-                                  "ID integer primary key autoincrement,"
-                                  "VALUE text unique,"
-                                  "SENTENCE_SIZE integer)",
-                                  NULL);
-
-  gda_execute_non_select_command (self->priv->db,
-                                  "create table TRANS ("
-                                  "ID integer primary key autoincrement,"
-                                  "ORIG_ID integer,"
-                                  "VALUE text)",
-                                  NULL);
-
-  gda_execute_non_select_command (self->priv->db,
-                                  "create index "
-                                  "if not exists IDX_TRANS_ORIG_ID "
-                                  "on TRANS (ORIG_ID)",
-                                  NULL);
+  gda_connection_execute_non_select_command (self->priv->db,
+                                             "create table WORD ("
+                                             "ID integer primary key autoincrement,"
+                                             "VALUE text unique)",
+                                             NULL);
+
+  gda_connection_execute_non_select_command (self->priv->db,
+                                             "create table WORD_ORIG_LINK ("
+                                             "WORD_ID integer,"
+                                             "ORIG_ID integer,"
+                                             "primary key (WORD_ID, ORIG_ID))",
+                                             NULL);
+
+  gda_connection_execute_non_select_command (self->priv->db,
+                                             "create table ORIG ("
+                                             "ID integer primary key autoincrement,"
+                                             "VALUE text unique,"
+                                             "SENTENCE_SIZE integer)",
+                                             NULL);
+
+  gda_connection_execute_non_select_command (self->priv->db,
+                                             "create table TRANS ("
+                                             "ID integer primary key autoincrement,"
+                                             "ORIG_ID integer,"
+                                             "VALUE text)",
+                                             NULL);
+
+  gda_connection_execute_non_select_command (self->priv->db,
+                                             "create index "
+                                             "if not exists IDX_TRANS_ORIG_ID "
+                                             "on TRANS (ORIG_ID)",
+                                             NULL);
 
   /* prepare statements */
 



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