[gnome-software: 1/2] gs-appstream: Support new libxmlb query binding API in 0.3.0
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 1/2] gs-appstream: Support new libxmlb query binding API in 0.3.0
- Date: Tue, 15 Dec 2020 10:59:16 +0000 (UTC)
commit f85d9bfd2c914d5617a710343be68fbe01ae1f15
Author: Philip Withnall <withnall endlessm com>
Date: Wed Aug 19 14:13:54 2020 +0100
gs-appstream: Support new libxmlb query binding API in 0.3.0
See https://github.com/hughsie/libxmlb/pull/67. This doesn’t bump the
hard version dependency.
Signed-off-by: Philip Withnall <withnall endlessm com>
plugins/core/gs-appstream.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 3f8fdfac..c2035f65 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -1079,8 +1079,14 @@ gs_appstream_silo_search_component2 (GPtrArray *array, XbNode *component, const
for (guint i = 0; i < array->len; i++) {
g_autoptr(GPtrArray) n = NULL;
GsAppstreamSearchHelper *helper = g_ptr_array_index (array, i);
+#if LIBXMLB_CHECK_VERSION(0, 3, 0)
+ g_auto(XbValueBindings) bindings = XB_VALUE_BINDINGS_INIT ();
+ xb_value_bindings_bind_str (&bindings, 0, search, NULL);
+ n = xb_node_query_with_bindings (component, helper->query, &bindings, NULL);
+#else
xb_query_bind_str (helper->query, 0, search, NULL);
n = xb_node_query_full (component, helper->query, NULL);
+#endif
if (n != NULL)
match_value |= helper->match_value;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]