[gnome-software/gnome-3-22] Do not refine the addons for non-desktop applications
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] Do not refine the addons for non-desktop applications
- Date: Tue, 15 Nov 2016 13:20:40 +0000 (UTC)
commit d15eed2037ca4cc57d10851f93408b0e9fd593aa
Author: Richard Hughes <richard hughsie com>
Date: Thu Nov 10 13:53:04 2016 +0000
Do not refine the addons for non-desktop applications
This speeds up a search operation by about ~8ms by not refining all the addons
of org.kde.plasmashell (which we don't show anyway).
src/plugins/gs-appstream.c | 18 ++++++++++++++++++
src/plugins/gs-plugin-appstream.c | 13 +++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index 1916ca8..73aad78 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -125,6 +125,17 @@ gs_appstream_refine_add_addons (GsPlugin *plugin, GsApp *app, AsApp *item)
{
GPtrArray *addons;
guint i;
+ g_autoptr(AsProfileTask) ptask = NULL;
+
+ /* we only care about addons to desktop apps */
+ if (gs_app_get_kind (app) != AS_APP_KIND_DESKTOP)
+ return;
+
+ /* search categories for the search term */
+ ptask = as_profile_start (gs_plugin_get_profile (plugin),
+ "appstream::refine-addons{%s}",
+ gs_app_get_unique_id (app));
+ g_assert (ptask != NULL);
addons = as_app_get_addons (item);
if (addons == NULL)
@@ -506,6 +517,13 @@ gs_appstream_refine_app (GsPlugin *plugin,
GPtrArray *kudos;
const gchar *tmp;
guint i;
+ g_autoptr(AsProfileTask) ptask = NULL;
+
+ /* search categories for the search term */
+ ptask = as_profile_start (gs_plugin_get_profile (plugin),
+ "appstream::refine-app{%s}",
+ gs_app_get_unique_id (app));
+ g_assert (ptask != NULL);
/* set the kind to be more precise */
if (gs_app_get_kind (app) == AS_APP_KIND_UNKNOWN ||
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 1398a3a..8ec448b 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -345,6 +345,13 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
GsPluginData *priv = gs_plugin_get_data (plugin);
const gchar *unique_id;
AsApp *item;
+ g_autoptr(AsProfileTask) ptask = NULL;
+
+ /* search categories for the search term */
+ ptask = as_profile_start (gs_plugin_get_profile (plugin),
+ "appstream::refine-from-id{%s}",
+ gs_app_get_unique_id (app));
+ g_assert (ptask != NULL);
/* unfound */
*found = FALSE;
@@ -391,6 +398,12 @@ gs_plugin_refine_from_pkgname (GsPlugin *plugin,
GPtrArray *sources;
const gchar *pkgname;
guint i;
+ g_autoptr(AsProfileTask) ptask = NULL;
+
+ /* search categories for the search term */
+ ptask = as_profile_start_literal (gs_plugin_get_profile (plugin),
+ "appstream::refine-from-pkgname");
+ g_assert (ptask != NULL);
/* find anything that matches the ID */
sources = gs_app_get_sources (app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]