[tracker/wip/carlosg/update-perf: 26/43] core: Make it possible to look up properties by short URIs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/update-perf: 26/43] core: Make it possible to look up properties by short URIs
- Date: Wed, 24 Aug 2022 00:49:50 +0000 (UTC)
commit 73df9685148d04a490cf65a6afadcde9f8454352
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]