[anjuta/wip/lantw/fix-libgda6-build] symbol-db: Fix build with the current libgda master branch



commit 77bf4308332d3660c136719c5590dd2e882e3f44
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Sat Sep 22 14:51:42 2018 +0800

    symbol-db: Fix build with the current libgda master branch
    
    GdaTimestamp has been removed and replaced by GDateTime. The version
    number went back to 5.90 and bumped to 5.91 on the libgda master branch.

 configure.ac                              |  2 +-
 plugins/symbol-db/symbol-db-engine-core.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/configure.ac b/configure.ac
index eeda3ed3e..569b81fe1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ GTHREAD_REQUIRED=2.22.0
 GDK_PIXBUF_REQUIRED=2.0.0
 GDA4_REQUIRED=4.2.0
 GDA5_REQUIRED=5.0.0
-GDA6_REQUIRED=5.99.0
+GDA6_REQUIRED=5.90.0
 LIBXML_REQUIRED=2.4.23
 GDL_REQUIRED=3.5.5
 LIBWNCK_REQUIRED=2.12
diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c
index 37d6e048a..c3f0d4f55 100644
--- a/plugins/symbol-db/symbol-db-engine-core.c
+++ b/plugins/symbol-db/symbol-db-engine-core.c
@@ -5443,7 +5443,11 @@ symbol_db_engine_update_project_symbols (SymbolDBEngine *dbe,
                                                                G_TYPE_STRING, 
                                                                G_TYPE_INT, 
                                                                G_TYPE_INT, 
+#ifdef HAVE_GDA6
+                                                               G_TYPE_DATE_TIME,
+#else
                                                                GDA_TYPE_TIMESTAMP, 
+#endif
                                                                G_TYPE_NONE
                                                        };
        data_model = gda_connection_statement_execute_select_full (priv->db_connection, 
@@ -5473,7 +5477,11 @@ symbol_db_engine_update_project_symbols (SymbolDBEngine *dbe,
        for (i = 0; i < num_rows; i++)
        {       
                const GValue *value, *value1;
+#ifdef HAVE_GDA6
+               GDateTime *timestamp;
+#else
                const GdaTimestamp *timestamp;
+#endif
                const gchar *file_name;
                gchar *file_abs_path = NULL;
                struct tm filetm;
@@ -5530,17 +5538,30 @@ symbol_db_engine_update_project_symbols (SymbolDBEngine *dbe,
                }
 
 
+#ifdef HAVE_GDA6
+               timestamp = g_value_get_boxed (value1);
+#else
                timestamp = gda_value_get_timestamp (value1);
+#endif
 
                /* fill a struct tm with the date retrieved by the string. */
                /* string is something like '2007-04-18 23:51:39' */
                memset (&filetm, 0, sizeof (struct tm));
+#ifdef HAVE_GDA6
+               filetm.tm_year = g_date_time_get_year (timestamp) - 1900;
+               filetm.tm_mon = g_date_time_get_month (timestamp) - 1;
+               filetm.tm_mday = g_date_time_get_day_of_month (timestamp);
+               filetm.tm_hour = g_date_time_get_hour (timestamp);
+               filetm.tm_min = g_date_time_get_minute (timestamp);
+               filetm.tm_sec = g_date_time_get_second (timestamp);
+#else
                filetm.tm_year = timestamp->year - 1900;                
                filetm.tm_mon = timestamp->month - 1;
                filetm.tm_mday = timestamp->day;
                filetm.tm_hour = timestamp->hour;
                filetm.tm_min = timestamp->minute;
                filetm.tm_sec = timestamp->second;
+#endif
 
                /* remove one hour to the db_file_time. */
                db_time = mktime (&filetm) - 3600;


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