[gnome-software/gnome-3-22] trivial: Don't call gs_plugin_refine_item_metadata() multiple times
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] trivial: Don't call gs_plugin_refine_item_metadata() multiple times
- Date: Mon, 7 Nov 2016 13:37:57 +0000 (UTC)
commit 39892c036335023bac4fd40683f76e2169e4b7c1
Author: Richard Hughes <richard hughsie com>
Date: Tue Sep 20 10:43:58 2016 +0100
trivial: Don't call gs_plugin_refine_item_metadata() multiple times
Also, add some profiling as it's kinda expensive...
(cherry picked from commit 69b0009e63a92f8b5192ee6002f198c7a340587c)
src/plugins/gs-flatpak.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 1615292..d38dcd6 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -1274,22 +1274,33 @@ gs_flatpak_set_app_metadata (GsFlatpak *self,
static gboolean
gs_plugin_refine_item_metadata (GsFlatpak *self,
- GsApp *app,
- GCancellable *cancellable,
- GError **error)
+ GsApp *app,
+ GCancellable *cancellable,
+ GError **error)
{
const gchar *str;
gsize len = 0;
g_autofree gchar *contents = NULL;
g_autofree gchar *installation_path_str = NULL;
g_autofree gchar *install_path = NULL;
+ g_autoptr(AsProfileTask) ptask = NULL;
g_autoptr(GBytes) data = NULL;
g_autoptr(GFile) installation_path = NULL;
+ /* profile */
+ ptask = as_profile_start (gs_plugin_get_profile (self->plugin),
+ "flatpak::refine-metadata{%s}",
+ gs_app_get_id (app));
+ g_assert (ptask != NULL);
+
/* not applicable */
if (gs_app_get_flatpak_kind (app) != FLATPAK_REF_KIND_APP)
return TRUE;
+ /* already done */
+ if (gs_app_has_kudo (app, GS_APP_KUDO_SANDBOXED))
+ return TRUE;
+
/* this is quicker than doing network IO */
installation_path = flatpak_installation_get_path (self->installation);
installation_path_str = g_file_get_path (installation_path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]