[tracker/wip/carlosg/serialize-api: 4/26] libtracker-data: Add missed GTypes in conversion




commit 5fe783a9d843539cecaa816660fb71d277b50c99
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 13 01:51:31 2021 +0100

    libtracker-data: Add missed GTypes in conversion
    
    Both TrackerUri and gint types may come from TrackerResource data,
    but is not handled here.

 src/libtracker-data/tracker-data-update.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index af78cae84..879483e1d 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -764,6 +764,9 @@ statement_bind_gvalue (TrackerDBStatement *stmt,
        case G_TYPE_STRING:
                tracker_db_statement_bind_text (stmt, (*idx)++, g_value_get_string (value));
                break;
+       case G_TYPE_INT:
+               tracker_db_statement_bind_int (stmt, (*idx)++, g_value_get_int (value));
+               break;
        case G_TYPE_INT64:
                tracker_db_statement_bind_int (stmt, (*idx)++, g_value_get_int64 (value));
                break;
@@ -806,6 +809,9 @@ statement_bind_gvalue (TrackerDBStatement *stmt,
                                /* String with langtag */
                                tracker_db_statement_bind_bytes (stmt, (*idx)++, bytes);
                        }
+               } else if (g_strcmp0 (g_type_name (type), "TrackerUri") == 0) {
+                       /* FIXME: We can't access TrackerUri GType here */
+                       tracker_db_statement_bind_text (stmt, (*idx)++, g_value_get_string (value));
                } else {
                        g_warning ("Unknown type for binding: %s\n", G_VALUE_TYPE_NAME (value));
                }


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