[gnome-software/1082-flatpak-origin-ui-string-doesn-t-use-repo-title] flatpak: Origin UI string doesn't use repo Title



commit 1ee906e431b82141ceb44f8648130fff28011951
Author: Milan Crha <mcrha redhat com>
Date:   Fri Dec 4 12:17:06 2020 +0100

    flatpak: Origin UI string doesn't use repo Title
    
    Prefer Flatpak's repository Title over its name in the UI, when set.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1082

 lib/gs-app.c                       |  36 ++++++++
 lib/gs-app.h                       |   2 +
 plugins/flatpak/gs-flatpak-utils.c |   5 +-
 plugins/flatpak/gs-flatpak.c       | 167 +++++++++++++++++++++++++++++++------
 4 files changed, 182 insertions(+), 28 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index e6946347..f0121cbe 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -78,6 +78,7 @@ typedef struct
        GsAppQuality             license_quality;
        gchar                   **menu_path;
        gchar                   *origin;
+       gchar                   *origin_ui;
        gchar                   *origin_appstream;
        gchar                   *origin_hostname;
        gchar                   *update_version;
@@ -587,6 +588,8 @@ gs_app_to_string_append (GsApp *app, GString *str)
                gs_app_kv_lpad (str, "branch", priv->branch);
        if (priv->origin != NULL && priv->origin[0] != '\0')
                gs_app_kv_lpad (str, "origin", priv->origin);
+       if (priv->origin_ui != NULL && priv->origin_ui[0] != '\0')
+               gs_app_kv_lpad (str, "origin-ui", priv->origin_ui);
        if (priv->origin_appstream != NULL && priv->origin_appstream[0] != '\0')
                gs_app_kv_lpad (str, "origin-appstream", priv->origin_appstream);
        if (priv->origin_hostname != NULL && priv->origin_hostname[0] != '\0')
@@ -4312,6 +4315,7 @@ gs_app_finalize (GObject *object)
        g_free (priv->license);
        g_strfreev (priv->menu_path);
        g_free (priv->origin);
+       g_free (priv->origin_ui);
        g_free (priv->origin_appstream);
        g_free (priv->origin_hostname);
        g_ptr_array_unref (priv->sources);
@@ -4608,8 +4612,18 @@ gs_app_new_from_unique_id (const gchar *unique_id)
 gchar *
 gs_app_get_origin_ui (GsApp *app)
 {
+       GsAppPrivate *priv;
+       g_autoptr(GMutexLocker) locker = NULL;
+
        g_return_val_if_fail (GS_IS_APP (app), NULL);
 
+       priv = gs_app_get_instance_private (app);
+       locker = g_mutex_locker_new (&priv->mutex);
+       if (priv->origin_ui && *priv->origin_ui)
+               return g_strdup (priv->origin_ui);
+
+       g_clear_pointer (&locker, g_mutex_locker_free);
+
        /* use the distro name for official packages */
        if (gs_app_has_quirk (app, GS_APP_QUIRK_PROVENANCE)) {
                g_autoptr(GsOsRelease) os_release = gs_os_release_new (NULL);
@@ -4634,6 +4648,28 @@ gs_app_get_origin_ui (GsApp *app)
        return g_strdup (gs_app_get_origin (app));
 }
 
+void
+gs_app_set_origin_ui (GsApp *app,
+                     const gchar *origin_ui)
+{
+       GsAppPrivate *priv;
+       g_autoptr(GMutexLocker) locker = NULL;
+
+       g_return_if_fail (GS_IS_APP (app));
+
+       priv = gs_app_get_instance_private (app);
+       locker = g_mutex_locker_new (&priv->mutex);
+
+       if (origin_ui && !*origin_ui)
+               origin_ui = NULL;
+
+       if (g_strcmp0 (priv->origin_ui, origin_ui) == 0)
+               return;
+
+       g_free (priv->origin_ui);
+       priv->origin_ui = g_strdup (origin_ui);
+}
+
 /**
  * gs_app_get_packaging_format:
  * @app: a #GsApp
diff --git a/lib/gs-app.h b/lib/gs-app.h
index 7b1608d3..d8a25966 100644
--- a/lib/gs-app.h
+++ b/lib/gs-app.h
@@ -395,6 +395,8 @@ void                 gs_app_remove_quirk            (GsApp          *app,
 gboolean        gs_app_is_installed            (GsApp          *app);
 gboolean        gs_app_is_updatable            (GsApp          *app);
 gchar          *gs_app_get_origin_ui           (GsApp          *app);
+void            gs_app_set_origin_ui           (GsApp          *app,
+                                                const gchar    *origin_ui);
 gchar          *gs_app_get_packaging_format    (GsApp          *app);
 void            gs_app_subsume_metadata        (GsApp          *app,
                                                 GsApp          *donor);
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 4dee1041..96a830e6 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -76,8 +76,10 @@ gs_flatpak_app_new_from_remote (FlatpakRemote *xremote)
 
        /* title */
        title = flatpak_remote_get_title (xremote);
-       if (title != NULL)
+       if (title != NULL) {
                gs_app_set_summary (app, GS_APP_QUALITY_LOWEST, title);
+               gs_app_set_origin_ui (app, title);
+       }
 
        /* url */
        url = flatpak_remote_get_url (xremote);
@@ -170,6 +172,7 @@ gs_flatpak_app_new_from_repo_file (GFile *file,
        gs_app_set_name (app, GS_APP_QUALITY_NORMAL, repo_title);
        gs_app_set_size_download (app, GS_APP_SIZE_UNKNOWABLE);
        gs_flatpak_app_set_repo_url (app, repo_url);
+       gs_app_set_origin_ui (app, repo_title);
        gs_app_set_origin_hostname (app, repo_url);
 
        /* user specified a URL */
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 507ad305..8921a69b 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -73,11 +73,90 @@ gs_flatpak_claim_app (GsFlatpak *self, GsApp *app)
        }
 }
 
+static GHashTable * /* gchr *remote name ~> gchar *remote title */
+gs_flatpak_cache_remotes_title (GsFlatpak *self,
+                               GCancellable *cancellable)
+{
+       GHashTable *remotes_title;
+       g_autoptr(GPtrArray) xremotes = NULL;
+
+       remotes_title = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+       xremotes = flatpak_installation_list_remotes (self->installation, cancellable, NULL);
+       if (xremotes) {
+               guint ii;
+
+               for (ii = 0; ii < xremotes->len; ii++) {
+                       FlatpakRemote *xremote = g_ptr_array_index (xremotes, ii);
+
+                       if (flatpak_remote_get_disabled (xremote) ||
+                           !flatpak_remote_get_name (xremote))
+                               continue;
+
+                       g_hash_table_insert (remotes_title, g_strdup (flatpak_remote_get_name (xremote)), 
flatpak_remote_get_title (xremote));
+               }
+       }
+
+       return remotes_title;
+}
+
+static void
+gs_flatpak_set_app_origin (GsFlatpak *self,
+                          GsApp *app,
+                          const gchar *origin,
+                          FlatpakRemote *xremote,
+                          GHashTable *remotes_title,
+                          GCancellable *cancellable)
+{
+       g_autofree gchar *tmp = NULL;
+       const gchar *title = NULL;
+
+       g_return_if_fail (GS_IS_APP (app));
+       g_return_if_fail (origin != NULL);
+
+       if (xremote) {
+               tmp = flatpak_remote_get_title (xremote);
+               title = tmp;
+       } else if (remotes_title) {
+               title = g_hash_table_lookup (remotes_title, origin);
+       } else {
+               g_autoptr(GPtrArray) xremotes = NULL;
+
+               xremotes = flatpak_installation_list_remotes (self->installation, cancellable, NULL);
+
+               if (xremotes) {
+                       guint ii;
+
+                       for (ii = 0; ii < xremotes->len; ii++) {
+                               FlatpakRemote *yremote = g_ptr_array_index (xremotes, ii);
+
+                               if (flatpak_remote_get_disabled (yremote))
+                                       continue;
+
+                               if (g_strcmp0 (flatpak_remote_get_name (yremote), origin) == 0) {
+                                       tmp = flatpak_remote_get_title (yremote);
+                                       title = tmp;
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       gs_app_set_origin (app, origin);
+       gs_app_set_origin_ui (app, title);
+}
+
 static void
-gs_flatpak_claim_app_list (GsFlatpak *self, GsAppList *list)
+gs_flatpak_claim_app_list (GsFlatpak *self,
+                          GsAppList *list,
+                          GHashTable *remotes_title)
 {
        for (guint i = 0; i < gs_app_list_length (list); i++) {
                GsApp *app = gs_app_list_index (list, i);
+
+               if (remotes_title && gs_app_get_origin (app))
+                       gs_flatpak_set_app_origin (self, app, gs_app_get_origin (app), NULL, remotes_title, 
NULL);
+
                gs_flatpak_claim_app (self, app);
        }
 }
@@ -238,7 +317,12 @@ gs_flatpak_set_metadata (GsFlatpak *self, GsApp *app, FlatpakRef *xref)
 }
 
 static GsApp *
-gs_flatpak_create_app (GsFlatpak *self, const gchar *origin, FlatpakRef *xref)
+gs_flatpak_create_app (GsFlatpak *self,
+                      const gchar *origin,
+                      FlatpakRef *xref,
+                      FlatpakRemote *xremote,
+                      GHashTable *remotes_title,
+                      GCancellable *cancellable)
 {
        GsApp *app_cached;
        g_autoptr(GsApp) app = NULL;
@@ -247,7 +331,7 @@ gs_flatpak_create_app (GsFlatpak *self, const gchar *origin, FlatpakRef *xref)
        app = gs_app_new (flatpak_ref_get_name (xref));
        gs_flatpak_set_metadata (self, app, xref);
        if (origin != NULL)
-               gs_app_set_origin (app, origin);
+               gs_flatpak_set_app_origin (self, app, origin, xremote, remotes_title, cancellable);
 
        /* return the ref'd cached copy */
        app_cached = gs_plugin_cache_lookup (self->plugin, gs_app_get_unique_id (app));
@@ -1023,8 +1107,10 @@ gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
 }
 
 static void
-gs_flatpak_set_metadata_installed (GsFlatpak *self, GsApp *app,
-                                  FlatpakInstalledRef *xref)
+gs_flatpak_set_metadata_installed (GsFlatpak *self,
+                                  GsApp *app,
+                                  FlatpakInstalledRef *xref,
+                                  GCancellable *cancellable)
 {
 #if FLATPAK_CHECK_VERSION(1,1,3)
        const gchar *appdata_version;
@@ -1083,7 +1169,7 @@ gs_flatpak_set_metadata_installed (GsFlatpak *self, GsApp *app,
 
        /* this is faster than resolving */
        if (gs_app_get_origin (app) == NULL)
-               gs_app_set_origin (app, flatpak_installed_ref_get_origin (xref));
+               gs_flatpak_set_app_origin (self, app, flatpak_installed_ref_get_origin (xref), NULL, NULL, 
cancellable);
 
        /* this is faster than flatpak_installation_fetch_remote_size_sync() */
        size_installed = flatpak_installed_ref_get_installed_size (xref);
@@ -1099,7 +1185,10 @@ gs_flatpak_set_metadata_installed (GsFlatpak *self, GsApp *app,
 
 static GsApp *
 gs_flatpak_create_installed (GsFlatpak *self,
-                            FlatpakInstalledRef *xref)
+                            FlatpakInstalledRef *xref,
+                            FlatpakRemote *xremote,
+                            GHashTable *remotes_title,
+                            GCancellable *cancellable)
 {
        g_autoptr(GsApp) app = NULL;
        const gchar *origin;
@@ -1108,10 +1197,10 @@ gs_flatpak_create_installed (GsFlatpak *self,
 
        /* create new object */
        origin = flatpak_installed_ref_get_origin (xref);
-       app = gs_flatpak_create_app (self, origin, FLATPAK_REF (xref));
+       app = gs_flatpak_create_app (self, origin, FLATPAK_REF (xref), xremote, remotes_title, cancellable);
        if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
                gs_app_set_state (app, AS_APP_STATE_INSTALLED);
-       gs_flatpak_set_metadata_installed (self, app, xref);
+       gs_flatpak_set_metadata_installed (self, app, xref, cancellable);
        return g_steal_pointer (&app);
 }
 
@@ -1120,6 +1209,7 @@ gs_flatpak_add_installed (GsFlatpak *self, GsAppList *list,
                          GCancellable *cancellable,
                          GError **error)
 {
+       g_autoptr(GHashTable) remotes_title = NULL;
        g_autoptr(GPtrArray) xrefs = NULL;
 
        /* get apps and runtimes */
@@ -1129,9 +1219,12 @@ gs_flatpak_add_installed (GsFlatpak *self, GsAppList *list,
                gs_flatpak_error_convert (error);
                return FALSE;
        }
+
+       remotes_title = gs_flatpak_cache_remotes_title (self, cancellable);
+
        for (guint i = 0; i < xrefs->len; i++) {
                FlatpakInstalledRef *xref = g_ptr_array_index (xrefs, i);
-               g_autoptr(GsApp) app = gs_flatpak_create_installed (self, xref);
+               g_autoptr(GsApp) app = gs_flatpak_create_installed (self, xref, NULL, remotes_title, 
cancellable);
                gs_app_list_add (list, app);
        }
 
@@ -1191,7 +1284,7 @@ gs_flatpak_add_sources (GsFlatpak *self, GsAppList *list,
                        if (g_strcmp0 (flatpak_installed_ref_get_origin (xref),
                                       flatpak_remote_get_name (xremote)) != 0)
                                continue;
-                       related = gs_flatpak_create_installed (self, xref);
+                       related = gs_flatpak_create_installed (self, xref, xremote, NULL, cancellable);
                        gs_app_add_related (app, related);
                }
        }
@@ -1246,7 +1339,7 @@ gs_flatpak_ref_to_app (GsFlatpak *self, const gchar *ref,
                FlatpakInstalledRef *xref = g_ptr_array_index (xrefs, i);
                g_autofree gchar *ref_tmp = flatpak_ref_format_ref (FLATPAK_REF (xref));
                if (g_strcmp0 (ref, ref_tmp) == 0)
-                       return gs_flatpak_create_installed (self, xref);
+                       return gs_flatpak_create_installed (self, xref, NULL, NULL, cancellable);
        }
 
        /* look at each remote xref */
@@ -1279,7 +1372,7 @@ gs_flatpak_ref_to_app (GsFlatpak *self, const gchar *ref,
                        g_autofree gchar *ref_tmp = flatpak_ref_format_ref (xref);
                        if (g_strcmp0 (ref, ref_tmp) == 0) {
                                const gchar *origin = flatpak_remote_get_name (xremote);
-                               return gs_flatpak_create_app (self, origin, xref);
+                               return gs_flatpak_create_app (self, origin, xref, xremote, NULL, cancellable);
                        }
                }
        }
@@ -1376,6 +1469,7 @@ gs_flatpak_app_install_source (GsFlatpak *self, GsApp *app,
 static GsApp *
 get_main_app_of_related (GsFlatpak *self,
                         GsApp *related_app,
+                        GHashTable *remotes_title,
                         GCancellable *cancellable,
                         GError **error)
 {
@@ -1417,12 +1511,13 @@ get_main_app_of_related (GsFlatpak *self,
        if (ref == NULL)
                return NULL;
 
-       return gs_flatpak_create_installed (self, ref);
+       return gs_flatpak_create_installed (self, ref, NULL, remotes_title, cancellable);
 }
 
 static GsApp *
 get_real_app_for_update (GsFlatpak *self,
                         GsApp *app,
+                        GHashTable *remotes_title,
                         GCancellable *cancellable,
                         GError **error)
 {
@@ -1430,7 +1525,7 @@ get_real_app_for_update (GsFlatpak *self,
        g_autoptr(GError) error_local = NULL;
 
        if (gs_flatpak_app_get_ref_kind (app) == FLATPAK_REF_KIND_RUNTIME)
-               main_app = get_main_app_of_related (self, app, cancellable, &error_local);
+               main_app = get_main_app_of_related (self, app, remotes_title, cancellable, &error_local);
 
        if (main_app == NULL) {
                /* not all runtimes are extensions, and in that case we get the
@@ -1458,6 +1553,7 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                        GCancellable *cancellable,
                        GError **error)
 {
+       g_autoptr(GHashTable) remotes_title = NULL;
        g_autoptr(GPtrArray) xrefs = NULL;
 
        /* ensure valid */
@@ -1473,6 +1569,8 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                return FALSE;
        }
 
+       remotes_title = gs_flatpak_cache_remotes_title (self, cancellable);
+
        /* look at each installed xref */
        for (guint i = 0; i < xrefs->len; i++) {
                FlatpakInstalledRef *xref = g_ptr_array_index (xrefs, i);
@@ -1491,8 +1589,8 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                        continue;
                }
 
-               app = gs_flatpak_create_installed (self, xref);
-               main_app = get_real_app_for_update (self, app, cancellable, &error_local);
+               app = gs_flatpak_create_installed (self, xref, NULL, remotes_title, cancellable);
+               main_app = get_real_app_for_update (self, app, remotes_title, cancellable, &error_local);
                if (main_app == NULL) {
                        g_debug ("Couldn't get the main app for updatable app extension %s: "
                                 "%s; adding the app itself to the updates list...",
@@ -1736,7 +1834,7 @@ gs_plugin_refine_item_origin (GsFlatpak *self,
                                                                   &error_local);
                if (xref != NULL) {
                        g_debug ("found remote %s", remote_name);
-                       gs_app_set_origin (app, remote_name);
+                       gs_flatpak_set_app_origin (self, app, remote_name, xremote, NULL, cancellable);
                        gs_flatpak_app_set_commit (app, flatpak_ref_get_commit (FLATPAK_REF (xref)));
                        gs_plugin_refine_item_scope (self, app);
                        return TRUE;
@@ -1825,7 +1923,7 @@ gs_flatpak_refine_app_state_unlocked (GsFlatpak *self,
        if (ref != NULL) {
                g_debug ("marking %s as installed with flatpak",
                         gs_app_get_unique_id (app));
-               gs_flatpak_set_metadata_installed (self, app, ref);
+               gs_flatpak_set_metadata_installed (self, app, ref, cancellable);
                if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
                        gs_app_set_state (app, AS_APP_STATE_INSTALLED);
 
@@ -2376,6 +2474,10 @@ gs_flatpak_refine_appstream_from_bytes (GsFlatpak *self,
        if (!gs_appstream_refine_app (self->plugin, app, silo, component_node, flags, error))
                return FALSE;
 
+       if (gs_app_get_origin (app)) {
+               gs_flatpak_set_app_origin (self, app, gs_app_get_origin (app), NULL, NULL, cancellable);
+       }
+
        /* use the default release as the version number */
        gs_flatpak_refine_appstream_release (component_node, app);
 
@@ -2521,6 +2623,7 @@ static gboolean
 gs_flatpak_refine_app_unlocked (GsFlatpak *self,
                                 GsApp *app,
                                 GsPluginRefineFlags flags,
+                               GHashTable *remotes_title,
                                 GCancellable *cancellable,
                                 GError **error)
 {
@@ -2619,6 +2722,9 @@ gs_flatpak_refine_app_unlocked (GsFlatpak *self,
                }
        }
 
+       if (gs_app_get_origin (app))
+               gs_flatpak_set_app_origin (self, app, gs_app_get_origin (app), NULL, remotes_title, 
cancellable);
+
        return TRUE;
 }
 
@@ -2633,7 +2739,7 @@ gs_flatpak_refine_app (GsFlatpak *self,
        if (!gs_flatpak_rescan_appstream_store (self, cancellable, error))
                return FALSE;
 
-       return gs_flatpak_refine_app_unlocked (self, app, flags, cancellable, error);
+       return gs_flatpak_refine_app_unlocked (self, app, flags, NULL, cancellable, error);
 }
 
 gboolean
@@ -2646,6 +2752,7 @@ gs_flatpak_refine_wildcard (GsFlatpak *self, GsApp *app,
        g_autoptr(GError) error_local = NULL;
        g_autoptr(GPtrArray) components = NULL;
        g_autoptr(GRWLockReaderLocker) locker = NULL;
+       g_autoptr(GHashTable) remotes_title = NULL;
 
        /* not enough info to find */
        id = gs_app_get_id (app);
@@ -2669,6 +2776,9 @@ gs_flatpak_refine_wildcard (GsFlatpak *self, GsApp *app,
                g_propagate_error (error, g_steal_pointer (&error_local));
                return FALSE;
        }
+
+       remotes_title = gs_flatpak_cache_remotes_title (self, cancellable);
+
        for (guint i = 0; i < components->len; i++) {
                XbNode *component = g_ptr_array_index (components, i);
                g_autoptr(GsApp) new = NULL;
@@ -2676,7 +2786,7 @@ gs_flatpak_refine_wildcard (GsFlatpak *self, GsApp *app,
                if (new == NULL)
                        return FALSE;
                gs_flatpak_claim_app (self, new);
-               if (!gs_flatpak_refine_app_unlocked (self, new, refine_flags, cancellable, error))
+               if (!gs_flatpak_refine_app_unlocked (self, new, refine_flags, remotes_title, cancellable, 
error))
                        return FALSE;
                gs_app_subsume_metadata (new, app);
                gs_app_list_add (list, new);
@@ -2781,7 +2891,7 @@ gs_flatpak_file_to_app_bundle (GsFlatpak *self,
                origin = flatpak_installed_ref_get_origin (installed_ref);
 
        /* load metadata */
-       app = gs_flatpak_create_app (self, origin, FLATPAK_REF (xref_bundle));
+       app = gs_flatpak_create_app (self, origin, FLATPAK_REF (xref_bundle), NULL, NULL, cancellable);
        if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED) {
                if (gs_flatpak_app_get_ref_name (app) == NULL)
                        gs_flatpak_set_metadata (self, app, FLATPAK_REF (xref_bundle));
@@ -2926,7 +3036,7 @@ gs_flatpak_file_to_app_ref (GsFlatpak *self,
        }
 
        /* load metadata */
-       app = gs_flatpak_create_app (self, NULL /* origin */, FLATPAK_REF (xref));
+       app = gs_flatpak_create_app (self, NULL /* origin */, FLATPAK_REF (xref), NULL, NULL, cancellable);
        if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED) {
                if (gs_flatpak_app_get_ref_name (app) == NULL)
                        gs_flatpak_set_metadata (self, app, FLATPAK_REF (xref));
@@ -2978,7 +3088,7 @@ gs_flatpak_file_to_app_ref (GsFlatpak *self,
                             flatpak_remote_get_name (xremote));
                return NULL;
        }
-       gs_app_set_origin (app, remote_name);
+       gs_flatpak_set_app_origin (self, app, remote_name, xremote, NULL, cancellable);
        gs_app_set_origin_hostname (app, origin_url);
 
        /* get the new appstream data (nonfatal for failure) */
@@ -3047,6 +3157,7 @@ gs_flatpak_search (GsFlatpak *self,
        g_autoptr(GRWLockReaderLocker) locker = NULL;
        g_autoptr(GMutexLocker) app_silo_locker = NULL;
        g_autoptr(GPtrArray) silos_to_remove = g_ptr_array_new ();
+       g_autoptr(GHashTable) remotes_title = NULL;
        GHashTableIter iter;
        gpointer key, value;
 
@@ -3058,7 +3169,9 @@ gs_flatpak_search (GsFlatpak *self,
                                  cancellable, error))
                return FALSE;
 
-       gs_flatpak_claim_app_list (self, list_tmp);
+       remotes_title = gs_flatpak_cache_remotes_title (self, cancellable);
+
+       gs_flatpak_claim_app_list (self, list_tmp, remotes_title);
        gs_app_list_add_list (list, list_tmp);
 
        /* Also search silos from installed apps which were missing from self->silo */
@@ -3095,7 +3208,7 @@ gs_flatpak_search (GsFlatpak *self,
                                          cancellable, error))
                        return FALSE;
 
-               gs_flatpak_claim_app_list (self, app_list_tmp);
+               gs_flatpak_claim_app_list (self, app_list_tmp, remotes_title);
                gs_app_list_add_list (list, app_list_tmp);
        }
 
@@ -3222,7 +3335,7 @@ gs_flatpak_add_recent (GsFlatpak *self,
                                      cancellable, error))
                return FALSE;
 
-       gs_flatpak_claim_app_list (self, list_tmp);
+       gs_flatpak_claim_app_list (self, list_tmp, NULL);
        gs_app_list_add_list (list, list_tmp);
 
        return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]