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




commit 039529c09d190dcff3bd2061dbcd9f4daf212045
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 | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/libtracker-sparql/core/tracker-ontologies.c b/src/libtracker-sparql/core/tracker-ontologies.c
index c9b3b4906..ffd83ca1a 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
@@ -424,6 +427,9 @@ tracker_ontologies_get_property_by_uri (TrackerOntologies *ontologies,
                        g_hash_table_insert (priv->property_uris,
                                             g_strdup (uri),
                                             property);
+                       g_hash_table_insert (priv->property_uris,
+                                            g_strdup (tracker_property_get_name (property)),
+                                            property);
                }
        }
 


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