[tracker/wip/carlosg/update-perf: 1/18] core: Make it possible to look up properties by short URIs




commit 418911eaeca35dbf69e2ca9a9e3874a3e8447ee3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 18 23:11:19 2022 +0200

    core: Make it possible to look up properties by short URIs
    
    In addition to the expanded URIs, make it possible to look up properties
    by short URI.

 src/libtracker-sparql/core/tracker-ontologies.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-sparql/core/tracker-ontologies.c b/src/libtracker-sparql/core/tracker-ontologies.c
index c9b3b4906..c54a42dba 100644
--- a/src/libtracker-sparql/core/tracker-ontologies.c
+++ b/src/libtracker-sparql/core/tracker-ontologies.c
@@ -384,6 +384,9 @@ tracker_ontologies_add_property (TrackerOntologies *ontologies,
        g_hash_table_insert (priv->property_uris,
                             g_strdup (uri),
                             g_object_ref (field));
+       g_hash_table_insert (priv->property_uris,
+                            g_strdup (tracker_property_get_name (field)),
+                            g_object_ref (field));
 }
 
 void
@@ -423,7 +426,12 @@ tracker_ontologies_get_property_by_uri (TrackerOntologies *ontologies,
 
                        g_hash_table_insert (priv->property_uris,
                                             g_strdup (uri),
-                                            property);
+                                            g_object_ref (property));
+                       g_hash_table_insert (priv->property_uris,
+                                            g_strdup (tracker_property_get_name (property)),
+                                            g_object_ref (property));
+
+                       g_object_unref (property);
                }
        }
 


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