[gnome-software/wip/hughsie/speedup-category-apps] Create a wildcard result when getting category apps
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/speedup-category-apps] Create a wildcard result when getting category apps
- Date: Mon, 15 Jul 2019 12:43:09 +0000 (UTC)
commit 9b250a70bebe9254a2c2c5c6604f5d4b7d0ec1f6
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 15 13:41:11 2019 +0100
Create a wildcard result when getting category apps
This allows us to always return the 'best' application for the popular and
picks subsections, and also means we only refine the GsApp once which is 2x
faster when there are a lot of results.
plugins/core/gs-appstream.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index ec6ade61..2999ab44 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -1170,11 +1170,11 @@ gs_appstream_add_category_apps (GsPlugin *plugin,
for (guint i = 0; i < components->len; i++) {
XbNode *component = g_ptr_array_index (components, i);
g_autoptr(GsApp) app = NULL;
-
- /* add all the data we can */
- app = gs_appstream_create_app (plugin, silo, component, error);
- if (app == NULL)
- return FALSE;
+ const gchar *id = xb_node_query_text (component, "id", NULL);
+ if (id == NULL)
+ continue;
+ app = gs_app_new (id);
+ gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
gs_app_list_add (list, app);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]